谢谢各位的支持,不过我想问一下hangc能不能取得任意对象的坐标。我取的是圆的圆心坐标,可怎么取也取不出,而且我的选择集里也没有Coordinates属性。
下面是我写的取坐标的按钮代码,我这取写就是取不出来坐标。希望哪位救救我
Private Sub Command7_Click() Dim sst As AcadSelectionSet Dim acadDc As Object
Set acadDc = acadapp.ActiveDocument
On Error Resume Next
If Not IsNull(acadDc.SelectionSets.Item("ss2")) Then Set sst = acadapp.ActiveDocument.SelectionSets.Add("ss2") sst.SelectOnScreen End If
MsgBox sst.Count & "个对象被选择"
For i = 0 To sst.Count - 1 MsgBox "对象是:" & sst.Item(i).ObjectName & Chr(13) & "坐标是:" Next
sst.Delete End Sub
For i = 0 To sst.Count - 1 '''你要遍历选择集中的每个实体,如果为圆,则取出圆心
'''如下列语句
Dim centerPoint As Variant centerPoint = circObj.center MsgBox "The center point of the circle is " & centerPoint(0) & ", " & centerPoint(1) & ", " & centerPoint(2), vbInformation, "Center Example"