import ezdxf, sys, math from collections import defaultdict sys.stdout.reconfigure(encoding='utf-8') d=ezdxf.readfile(r'D:\★Pier 자료\심수석님 검토 파일\철근 모델랑 운곡교P1_바이브코딩\1.dxf'); ms=d.modelspace() cnt=defaultdict(list) def add(a,b,layer): L=math.hypot(b[0]-a[0],b[1]-a[1]) if 3000.3 and abs(ang-90)>0.3: cnt[(layer,ang)].append((round((a[0]+b[0])/2),round((a[1]+b[1])/2),round(L))) for e in ms: t=e.dxftype() if t=='LINE': a,b=e.dxf.start,e.dxf.end if 12500=2: print(k,len(v),sorted(v)[:4])