Код: Выделить всё
import array
from _ast import If
import comtypes.client
import pyautocad
#Get running instance of the AutoCAD application
acad = comtypes.client.GetActiveObject("AutoCAD.Application")
# Document object
doc = acad.ActiveDocument
#Get the ModelSpace object
ms = doc.ModelSpace
#In ModelSpace
#Set up A4 Space
pt1 = array.array('d', [0.0, 0.0, 0])
pt2 = array.array('d', [210.0, 0.0, 0])
pt3 = array.array('d', [210.0, 297.0, 0])
pt4 = array.array('d', [0.0, 297.0, 0])
line1 = ms.AddLine(pt1, pt2)
line2 = ms.AddLine(pt2, pt3)
line3 = ms.AddLine(pt3, pt4)
line4 = ms.AddLine(pt4, pt1)
#Add central fold
pt5 = array.array('d', [105.0, 0.0, 0])
pt6 = array.array('d', [105.0, 297.0, 0])
line5 = ms.AddLine(pt5, pt6)
print("Done.")
Подробнее здесь: https://stackoverflow.com/questions/425 ... te-autocad