使用Coordinates属性来获取:- Sub GetPointCoor() Dim ss As AcadSelectionSet
- On Error Resume Next
- ThisDrawing.SelectionSets("mccad").Delete
- Set ss = ThisDrawing.SelectionSets.Add("mccad")
- ss.Select acSelectionSetAll
-
- Dim ent As AcadEntity
- Dim pnt As AcadPoint
- Dim pntcoor As Variant
- Dim txt As String
-
- For Each ent In ss
- If ent.ObjectName = "AcDbPoint" Then
- Set pnt = ent
- pntcoor = pnt.Coordinates
- txt = txt & pntcoor(0) & "," & pntcoor(1) & "," & pntcoor(2) & vbCr
- End If
- Next
-
- MsgBox txt, , "明经通道VBA示例http://www.mjtd.com"
-
- End Sub
|