急!!请教哪位知道炸开多层嵌套图形(块)的VBA代码
本帖最后由 作者 于 2005-1-14 13:23:23 编辑如题。 谢谢! Function ExplodeBlockRef(pBlockRef) As Collection<BR>On Error Resume Next<BR>Dim i, j<BR>Dim pEnts<BR>Dim EBR As New Collection<BR>pEnts = pBlockRef.Explode<BR>For i = 0 To UBound(pEnts)<BR>If pEnts(i).ObjectName <> "AcDbBlockReference" Then<BR>EBR.Add pEnts(i)<BR>Else<BR>Set Es = ExplodeBlockRef(pEnts(i))<BR>pEnts(i).Delete<BR>For j = 1 To Es.Count<BR>EBR.Add Es(j)<BR>Next j<BR>End If<BR>Next i<BR>Set ExplodeBlockRef = EBR<BR>End Function
Sub tt()<BR>Dim obj As AcadEntity<BR>ThisDrawing.Utility.GetEntity obj, pnt<BR>MsgBox ExplodeBlockRef(obj).Count<BR>End Sub<BR> 多谢雪山飞狐版主!!! 太妙了,帮我解决了个大问题,谢谢了
页:
[1]