[求助]怎样获得一个选择集中点的坐标
请问,我有一个选择集,里面全部为点,怎样才能获得它们的坐标呢(遍历选择集后,用哪个属性呢)?谢谢! 使用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
知道了,多谢!
页:
[1]