import ezdxf, sys from collections import defaultdict sys.stdout.reconfigure(encoding='utf-8') d=ezdxf.readfile(r'D:\★Pier 자료\심수석님 검토 파일\철근 모델랑 운곡교P1_바이브코딩\1.dxf'); ms=d.modelspace() def run(name,x0,x1,y0,y1,cx,topy,boty): V=defaultdict(list);H=defaultdict(list) for e in ms: if e.dxftype()=='LINE' and e.dxf.layer=='CS-RBAR-MAJR': a,b=e.dxf.start,e.dxf.end if not(x0 y range, inset from top/bottom):') for x in sorted(V): for y0_,y1_ in sorted(V[x]): print(' Y %+.1f'%(x-cx),'y',y0_,'~',y1_,'| 상단 %.1f 아래, 하단 %.1f 위'%(topy-y1_,y0_-boty)) print('horizontal lines:') for y in sorted(H,reverse=True): for a,b in sorted(H[y]): print(' y',y,'Y',round(a-cx,1),'~',round(b-cx,1),'| top-%.1f bot+%.1f'%(topy-y,y-boty)) run('A-A',43000,46100,23200,24680,44570.3,24691.5,23159.7) run('B-B',43100,46300,10450,13620,44735.4,13624.2,10480.2)