1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import time
- import ezdxf
- doc = ezdxf.new('R2000')
- msp = doc.modelspace()
- out_width = 10374
- out_height = 8593
- start_point = (0, 0)
- first_point_row = 375
- first_point_col = 1000
- msp.add_line(start_point, (start_point[0], start_point[1] + first_point_col))
- msp.add_line(start_point, (start_point[0] + first_point_row, start_point[1]))
- msp.add_line(start_point,(start_point[0],start_point[1]+out_height))
- msp.add_line(start_point,(start_point[0]+out_width,start_point[1]))
- msp.add_line((start_point[0] + out_width, start_point[1]), (start_point[0] + out_width, start_point[1] + out_height))
- msp.add_line((start_point[0]+out_width,start_point[1]+out_height),(start_point[0]+out_width,start_point[1]+out_height))
- msp.add_line(start_point,(start_point[0],start_point[1]+out_height))
- msp.add_line(start_point,(start_point[0]+out_width,start_point[1]))
- msp.add_line((start_point[0] + out_width, start_point[1]), (start_point[0] + out_width, start_point[1] + out_height))
- msp.add_line((start_point[0]+out_width,start_point[1]+out_height),(start_point[0]+out_width,start_point[1]+out_height))
- cursor_col = start_point[1] + first_point_col
- while (cursor_col < out_height):
- msp.add_line((start_point[0], cursor_col), ((start_point[0] + out_width), cursor_col))
- cursor_col = cursor_col + 1000
- cursor_row = start_point[0] + first_point_row
- while (cursor_row < out_width):
- msp.add_line((cursor_row, start_point[1]), (cursor_row, (start_point[1] + out_height)))
- cursor_row = cursor_row + 1000
- a = time.time()
- doc.saveas(f'save/bottom{str(a)}.dxf')
|