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