永发信息网

求autocad vba高手写一个用鼠标选择图形中某条多段线,把所选择的多段线项点输出到EXCEL的代码!

答案:1  悬赏:80  手机版
解决时间 2021-01-29 07:57
  • 提问者网友:伴风望海
  • 2021-01-28 07:23
希望能注释每句代码的意思!
最佳答案
  • 五星知识达人网友:由着我着迷
  • 2021-01-28 08:30
输出顶点坐标的格式是什么样的?
Sub a()
Dim retCoord() As Double
Dim a As AcadLWPolyline
Dim i As Integer
Dim Excel As Excel.Application
Dim ExcelSheet As Object
Dim ExcelWorkbook As Object
i = 0
ThisDrawing.Utility.GetEntity a, "Select an object"
retCoord() = a.Coordinates
Set Excel = New Excel.Application
Set ExcelWorkbook = Excel.Workbooks.Open("excel文件目录")
Set ExcelSheet = Excel.ActiveSheet
Excel.Visible = True
On Error GoTo e
Do While CBool(retCoord(i)) <> False
ExcelSheet.Cells(i + 1, 1).Value = retCoord(i)
i = i + 1
Loop
e: Exit Sub
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯