excel-cad思路 excel调用cad Function ConnectCad() As AcadApplication Dim App As AcadApplication On Error Resume Next Set App = GetObject(, "AutoCad.Application") If Err Then Err.Clear Set App = CreateObject("AutoCad.Application") End If App.Visible = True Set ConnectCad = App End Function 坐标提取的思路 Dim cadapp As AcadApplication Set cadapp = ConnectCad for each ent in cadapp.ActiveDocument.ModelSpace dim objLine as AcadEntiti If InStr(UCase(Ent.ObjectName), "ACDBLINE") > 0 Then Set objLine = Ent With objLine cells(ii,1)= .StartPoint(0) ...... End With End If next ent |