用pywin32库连接cad之后,插入一个动态块,但是不知道该如何修改其自定义动态尺寸,求大神指教。
import pythoncom
import win32com.client
wincad = win32com.client.Dispatch("AutoCAD.Application")
doc = wincad.ActiveDocument
doc.Utility.Prompt("Hello! Autocad from pywin32com.\n")
msp = doc.ModelSpace
slt = doc.SelectionSets
print(doc.Name)
def vtpnt(x, y, z = 0):
return win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, (x, y, z))
def vtobj(obj):
return win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_DISPATCH, obj)
def vtfloat(lst):
return win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, lst)
PoA = vtpnt(0, 0)
PoB = vtpnt(100, 100)
# lineObj = msp.AddLine(PoA, PoB)
Block = msp.InsertBlock(PoA,"A$C497ee0a2",1,1,1,0)
Vabc = Block.GetAttributes