如何在EXCEL中用VBA取CAD中多段线的坐标

2024-12-03 05:25:19
推荐回答(1个)
回答1:

Subkkk()DimacadAppAsAcadApplicationDimacaddocsAsAcadDocumentsDimacaddocAsAcadDocumentOnErrorResumeNextSetacadApp=CreateObject("AutoCAD.Application")Setacaddoc=acadApp.ActiveDocumentacadApp.Visible=TrueDimmylineAsAcadLWPolylineDimmylist(5)AsDoublemylist(0)=Cells(1,1)mylist(1)=Cells(1,2)mylist(2)=Cells(2,1)mylist(3)=Cells(2,2)mylist(4)=Cells(3,1)mylist(5)=Cells(3,2)Setmyline=acaddoc.ModelSpace.AddLightWeightPolyline(mylist)EndSub