PYCAD 一键炸开嵌套块
# -*- coding: utf-8 -*
from pycad.runtime import *
from pycad.system import *
@command()
def deep_ex(doc):
with dbtrans(doc) as tr:
btr = tr.opencurrspace()
def bre_expcoll(obj):
print(obj)
dbobjcoll = acdb.DBObjectCollection()
obj.Explode( dbobjcoll)
tr.erase(obj)
return dbobjcoll
def check(coll):
for x in coll:
xid=tr.addentity(btr,x)[0]
if xid.ObjectClass.DxfName == 'INSERT':
check(bre_expcoll(xid.GetObject(acdb.OpenMode.ForWrite)))
obj_id = edx.entsel("\n选择操作对象").ObjectId
dxfname = obj_id.ObjectClass.DxfName
if dxfname == 'INSERT':
check(bre_expcoll(tr.getobject(obj_id)))
楼主辛苦,感谢提供! 测试反馈:嵌套块的子块为属性块时,属性值不是当前值 oldstone 发表于 2023-11-10 16:24
测试反馈:嵌套块的子块为属性块时,属性值不是当前值
用cad自带的炸开命令也是这样
页:
[1]