import ezdxf, sys from collections import defaultdict sys.stdout.reconfigure(encoding='utf-8') d=ezdxf.readfile(r'D:\★Pier 자료\심수석님 검토 파일\철근 모델랑 운곡교P1_바이브코딩\2.dxf'); ms=d.modelspace() X0,X1,Y0,Y1=17500,26500,26000,31600 H=defaultdict(list);V=defaultdict(list) for e in ms: if e.dxftype()=='LINE' and e.dxf.layer in('CS-RBAR-MAJR','CS-CONC-MAJR'): a,b=e.dxf.start,e.dxf.end if X0