请问各位大师:
本人写了下面一个程式就是想通过框选一个块来取得块的圆心,然后在这圆心处画一个螺丝孔(其中选择的块是圆组成的),但结果不行,如果将块换成是一个圆,则可以用
selobj.center属性来取得圆心,请老手指点怎么可以取得由圆组成的块的圆心,多谢!
Public Sub c(layerr As String)
Dim ssetobj1 As AcadSelectionSet Dim icount1 As Integer icount1 = ThisDrawing.SelectionSets.Count While (icount1 > 0) If ThisDrawing.SelectionSets.Item(icount1 - 1).Name = "yuan" Then ThisDrawing.SelectionSets.Item(icount1 - 1).Delete End If icount1 = icount1 - 1 Wend Set ssetobj1 = ThisDrawing.SelectionSets.Add("yuan") ThisDrawing.Utility.Prompt "please select object" ssetobj1.SelectOnScreen Dim i1 As Integer Dim selobj1 As Acadblock For i1 = 0 To ssetobj1.Count - 1 Set selobj1 = ssetobj1.Item(i1) dim pt as double
dim circ as acadcircle
pt=selobj1.center
set circ = thisdrawing.modelspace.addcircle(pt,10)
Next
|