티스토리 뷰
판넬 자동작도를 하면서 만든 코드를 하나씩 풀어볼까 합니다.
우선, import문을 정리합니다.
자동작도의 길을 걸어가고 있습니다.
import math
import ezdxf
from ezdxf.enums import TextEntityAlignment
import openpyxl
import os
import glob
import time
import os
import sys
import io
from datetime import datetime
import json
from gooey import Gooey, GooeyParser
import warnings
import re
import logging
import tkinter as tk
from tkinter import font
import requests
이제 전역변수의 초기화.... 도면을 그리기 위해서 기본값을 세팅해봅니다.
# 전역 변수 초기화
if True:
handrailsidegaps_left, handrailsidegaps_right, handrailreargaps , total_gaps_left, total_gaps_right, total_reargaps =[],[],[],[],[],[]
P5_cartxpos, P6_cartxpos, P7_cartxpos = [],[],[]
dwgnum_dict = {}
BasicXscale, BasicYscale,TargetXscale,TargetYscale, frame_scale = 0,0,0,0,0
frameXpos = 0
frameYpos = 0
base_dwgnum = None
drawdate_str = ""
thickness = 0
T5_is = ""
OP = 0
selected_dimstyle = ''
over1000dim_style = ''
OPH = 0
KPH = 0
TRH = 0
TR_width = 0
br = 0 # bending rate 연신율
saved_DimXpos = 0
saved_DimYpos = 0
saved_Xpos = 0
saved_Ypos = 0
saved_direction = "up"
saved_text_height = 0.38
saved_text_gap = 0.05
dimdistance = 0
dim_horizontalbase = 0
dim_verticalbase = 0
distanceXpos = 0
distanceYpos = 0
start_time = 0
secondord = None
drawdate_str = None
company = None
workplace = None
drawnby = None
inspectedby = None
approvedby = None
issuedate = None
usage = None
openType = None
person = None
SU = None
carOP = None
carOPH = None
KH = None
FH = None
Material = None
Spec = None
thickness_string = None
Vcut = None
VcutPlus = 0
doorDevice = None
CW = None
CD = None
CH = None
popnut_bottom = None
popnut_top = None
CPH = None
SIDE = None
REAR = None
WF = None
WS = None
WSM = None
WR = None
WRM = None
trimMaterial = None
TR1 = None
TR2 = None
TR3 = None
TR4 = None
TR5 = None
TR6 = None
P1_material = None
P1_width = 0
P1_widthReal = None
P1_holegap = None
P1_hole1 = None
P1_hole2 = None
P1_hole3 = None
P1_hole4 = None
P1_hole5 = None
P1_hole6 = None
P1_COP = None
P2_material = None
P2_width = 0
P2_widthReal = None
P2_holegap = None
P2_hole1 = None
P2_hole2 = None
P2_hole3 = None
P2_hole4 = None
P2_hole5 = None
P2_hole6 = None
P2_COP = None
P3_material = None
P3_width = 0
P3_widthReal = None
P3_holegap = None
P3_hole1 = None
P3_hole2 = None
P3_hole3 = None
P3_hole4 = None
P3_hole5 = None
P3_hole6 = None
P3_COP = None
P4_material = None
P4_width = 0
P4_widthReal = None
P4_holegap = None
P4_hole1 = None
P4_hole2 = None
P4_hole3 = None
P4_hole4 = None
P4_hole5 = None
P4_hole6 = None
P4_COP = None
P5_material = None
P5_width = 0
P5_widthReal = None
P5_holegap = None
P5_hole1 = None
P5_hole2 = None
P5_hole3 = None
P5_hole4 = None
P5_hole5 = None
P5_hole6 = None
P5_COP = None
P6_material = None
P6_width = 0
P6_widthReal = None
P6_holegap = None
P6_hole1 = None
P6_hole2 = None
P6_hole3 = None
P6_hole4 = None
P6_hole5 = None
P6_hole6 = None
P6_COP = None
P7_material = None
P7_width = 0
P7_widthReal = None
P7_holegap = None
P7_hole1 = None
P7_hole2 = None
P7_hole3 = None
P7_hole4 = None
P7_hole5 = None
P7_hole6 = None
P7_COP = None
P8_material = None
P8_width = 0
P8_widthReal = None
P8_holegap = None
P8_hole1 = None
P8_hole2 = None
P8_hole3 = None
P8_hole4 = None
P8_hole5 = None
P8_hole6 = None
P8_COP = None
P9_material = None
P9_width = 0
P9_widthReal = None
P9_holegap = None
P9_hole1 = None
P9_hole2 = None
P9_hole3 = None
P9_hole4 = None
P9_hole5 = None
P9_hole6 = None
P9_COP = None
P10_material = None
P10_width = 0
P10_widthReal = None
P10_holegap = None
P10_hole1 = None
P10_hole2 = None
P10_hole3 = None
P10_hole4 = None
P10_hole5 = None
P10_hole6 = None
P10_COP = None
P11_material = None
P11_width = 0
P11_widthReal = None
P11_holegap = None
P11_hole1 = None
P11_hole2 = None
P11_hole3 = None
P11_hole4 = None
P11_hole5 = None
P11_hole6 = None
P11_COP = None
COP_bottomHeight = None
COP_centerdistance = None
COP_width = None
COP_height = None
COP_holegap = None
COP_RibType = None
HOP_bottomHeight = None
HOP_width = None
HOP_height = None
HOP_holegap = None
HOP_RibType = None
HRType = None
handrail_height = None
handrailsidegap1 = None
handrailsidegap2 = None
handrailsidegap3 = None
handrailsidegap4 = None
handrailsidegap5 = None
HRFrontHolesize = None
handrailreargap1 = None
handrailreargap2 = None
handrailreargap3 = None
handrailreargap4 = None
handrailreargap5 = None
HRRearHolesize = None
KP_material = None
TR_OP = None
TR_TRH = None
TR_upperhole1 = None
TR_upperhole2 = None
TR_upperhole3 = None
TR_upperhole4 = None
TR_material = None
CPI_type = None
CPIHoleWidth = 0
CPIHoleHeight = 0
CPIholegap = 0
CPIHeight = 0
updateCPIHoleWidth = 0
updateCPIHoleHeight = 0
updateCPIholegap = 0
updateCPIHeight = 0
COL_Height = None
column_thickness = None
column_width = None
column_width_sep = None
COL_Material = None
column_BottomHoleHorizontal = None
column_BottomHoleVertical = None
ELB_bottomHeight = None
ELB_BoxHorizontal = None
ELB_BoxVertical = None
ELB_RibType = None
CartP_Type = None
CartP_Height = None
CartP_holegap1 = None
CartP_holegap2 = None
CartP_holegap3 = None
CartP_holegap4 = None
CartP_holegap5 = None
CartP_HoleSize = None
panel_width = None
P1_height = 0
P2_height = 0
P3_height = 0
P4_height = 0
P5_height = 0
P6_height = 0
P7_height = 0
P8_height = 0
P9_height = 0
P10_height = 0
P11_height = 0
dwgnum0 = None
dwgnum1 = None
dwgnum2 = None
dwgnum3 = None
dwgnum4 = None
dwgnum5 = None
dwgnum6 = None
dwgnum7 = None
dwgnum8 = None
dwgnum9 = None
dwgnum10 = None
dwgnum11 = None
dwgnum12 = None
dwgnum13 = None
dwgnum14 = None
dwgnum15 = None
dwgnumber = None
TR_EChole = None
error_message = ''
cshape_ribcount = 0
hatshape_ribcount = 0
panel_wing = 0
pagex = 0
pagey = 0
rx, ry = 0, 0
P1_handrailxpos, P2_handrailxpos, P3_handrailxpos, P4_handrailxpos, P5_handrailxpos, P6_handrailxpos, P7_handrailxpos, P8_handrailxpos, P9_handrailxpos, P10_handrailxpos, P11_handrailxpos = [[] for _ in range(11)]
panel_info , component_info = [],[]
handrailCircleNumber = 4 # 핸드레일 주기번호
ladder_bottomHeight, ladder_width, ladder_height = 0, 0, 0
CHFH = 0
# 전역 변수 선언 및 초기화
for i in range(1, 31):
globals()[f'x{i}'] = 0
globals()[f'y{i}'] = 0
# 전역 변수 선언 및 초기화
for i in range(1, 12):
globals()[f'P{i}_platewidth'] = 0
globals()[f'P{i}_plateheight'] = 0
globals()[f'P{i}_hole'] = []
계속 이어지는 코드를 기대해 주세요~
이렇게 선언을 하고 main() 함수로 들어가서 이제 코딩을 하나씩 진행합니다.
'IT tech Coding > python' 카테고리의 다른 글
python 캐드 치수선 '직선거리' 1000 치수선 성질 유지하기 ezdxf (0) | 2024.12.12 |
---|---|
python 조건문 활용으로 프로그래밍 효율성을 높이는 방법 (0) | 2024.12.05 |
두 개의 엑셀 파일을 비교하고 추가된 행만 추출하는 파이썬 코드 (0) | 2024.08.20 |
OSError: [WinError 193] %1은(는) 올바른 Win32 응용 프로그램이 아닙니다 (0) | 2024.08.09 |
global 선언을 수백개 인경우는 어떻게 하면 더 좋을까? (0) | 2024.07.07 |
- Total
- Today
- Yesterday
- 스크립트작성기초
- 프로그래머생활
- json파일편하게보는법
- #파이썬패키징
- 엑셀보호
- 구글드라이브API
- 엑셀셀보호
- 엑셀입력보호
- sql문장 날짜계산
- General error: 2031
- #InstallForge
- ajax오류메시지
- 1. #웹개발 2. #로트번호 3. #성적서보기 4. #ajax 5. #jquery 6. #php 7. #프론트엔드 8. #백엔드 9. #부트스트랩 10. #웹기능구현
- #프로그램설치
- Bootstrap 5
- 오토핫키가이드
- 오블완
- #NSIS
- 티스토리챌린지
- 테크에능한여성
- 코딩효율성
- 파이썬코드줄바꿈방법
- chatGPT3.5파이썬버전
- coalesce는 한국어로 "코얼레스크" 또는 "코얼리스"
- 효율적코딩방법
- #InnoSetup
- 코딩튜토리얼
- json파일형태보기
- isset을 적용해야 하는 이유
- 뫄프로그래밍
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |