明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2002|回复: 3

急!!请教哪位知道炸开多层嵌套图形(块)的VBA代码

[复制链接]
发表于 2005-1-13 03:04:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2005-1-14 13:23:23 编辑

如题。 谢谢!
发表于 2005-1-16 22:19:00 | 显示全部楼层
Function ExplodeBlockRef(pBlockRef) As Collection
On Error Resume Next
Dim i, j
Dim pEnts
Dim EBR As New Collection
pEnts = pBlockRef.Explode
For i = 0 To UBound(pEnts)
If pEnts(i).ObjectName <> "AcDbBlockReference" Then
EBR.Add pEnts(i)
Else
Set Es = ExplodeBlockRef(pEnts(i))
pEnts(i).Delete
For j = 1 To Es.Count
EBR.Add Es(j)
Next j
End If
Next i
Set ExplodeBlockRef = EBR
End Function Sub tt()
Dim obj As AcadEntity
ThisDrawing.Utility.GetEntity obj, pnt
MsgBox ExplodeBlockRef(obj).Count
End Sub
 楼主| 发表于 2005-1-17 05:47:00 | 显示全部楼层
多谢雪山飞狐版主!!!
发表于 2011-2-4 21:34:05 | 显示全部楼层
太妙了,帮我解决了个大问题,谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-2-22 02:51 , Processed in 0.196003 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表