高手请指教:
请问一下哪位高手,在vba中怎样得到所选择物体的圆心(假如所选择的物体是圆),我有如下一个程式,就是改色(这个简单),
Public Sub pi() Dim ssetobj As AcadSelectionSet Dim icount As Integer icount = ThisDrawing.SelectionSets.Count While (icount > 0) If ThisDrawing.SelectionSets.Item(icount - 1).Name = "yuan" Then ThisDrawing.SelectionSets.Item(icount - 1).Delete End If icount = icount - 1 Wend Set ssetobj = ThisDrawing.SelectionSets.Add("yuan") ThisDrawing.Utility.Prompt "please select object" ssetobj.SelectOnScreen Dim i As Integer Dim selobj As AcadEntity
For i = 0 To ssetobj.Count - 1 Set selobj = ssetobj.Item(i) If selobj.ObjectName = "AcDbCircle" Then
selobj.color = acBlue MsgBox nam
End If Next End Sub
现在请问一下高手,我怎么样才可以得到这样圆心的坐标
因为不可以象这样写
dim centerpt(0 to 2) as double
centerpt=selobj.center (因为这里的selobj没有center中心这样属性)
请高手指教,用怎样的方法才可以得到所选物体的圆心再赋给一变量
因为我想用这个圆心来画别的东本,而visual Lisp 中则有一个这样的
函数 Val-get-center,现在请教高手在vba里可以用什么方法
多谢!
|