1,先引用acad
2,调用acad
Public Function CallCAD() On Error Resume Next Dim AcadApp As AcadApplication Set AcadApp = GetObject(, "AutoCAD.Application") If Err Then Err.Clear Set AcadApp = CreateObject("AutoCAD.Application") AcadApp.Visible = True If Err Then MsgBox Err.Description Exit Function End If End If Set acadDoc = AcadApp.ActiveDocument End Function
3,set EntyObj = acadDoc.HandletoObject("54EA") |