炸开块、属性
[*];;--en 图元名---------炸块、属性---------(一级)----------------------------------------------------------------------
[*](defun exp-blk (en / attnam da p h attb k e el blkdef Expable)
[*](if (= (dxf1 en 66) 1)
[*] (progn
[*] (setq attnam (entnext en) da (entget attnam) k (cdr (assoc 1 da)))
[*] (setq attb nil)
[*] (while (= "ATTRIB" (cdr (assoc 0 da)))
[*] (setq p (cdr (assoc 10 da)))
[*] (setq h (cdr (assoc 40 da)))
[*] (setq attb (cons (list k h p) attb))
[*] (if (/= "STAR" (cdr (assoc 2 da)))
[*] (command "text" p h 0 k)
[*] )
[*] (setq attnam (entnext attnam) da (entget attnam) k (cdr (assoc 1 da)))
[*] )
[*] (command "explode" en)
[*] )
[*])
[*](cond
[*] ((and (= "INSERT" (cdr (assoc 0 (setq el (entget en)))))
[*] (vlax-property-available-p (setq blkdef (vla-item (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object))) (cdr (assoc 2 el)))) 'Explodable) ;;;不允许炸开块
[*] )
[*] (if (eq :vlax-false (setq Expable (vla-get-Explodable blkdef)))
[*] (vla-put-Explodable blkdef :vlax-true)
[*] ) ;_ 修改为可分解属性
[*] (VL-CATCH-ALL-APPLY 'vla-explode (list (vlax-ename->vla-object en))) ;_ 炸块
[*] (if Expable
[*] (vla-put-Explodable blkdef Expable)
[*] ) ;_ 恢复不可分解属性
[*] )
[*] ((and (= "INSERT" (cdr (assoc 0 (setq el (entget en)))))
[*] (= (vlax-property-available-p (vlax-ename->vla-object en) "Path") nil) ;;非参照
[*] (= (vla-get-objectname(vlax-ename->vla-object en)) "AcDbBlockReference");;;普通块
[*] )
[*] (command "explode" en)
[*] )
[*] ((and (= "INSERT" (cdr (assoc 0 (setq el (entget en)))))
[*] (= (vla-get-objectname(vlax-ename->vla-object en)) "acdbminsertblock");;;多重插入块
[*] )
[*] (setq e (entget en))
[*] (setq e (emod e 44 0))
[*] (setq e (emod e 45 0))
[*] (setq e (emod e 70 0))
[*] (setq e (emod e 71 0))
[*] (setq e (subst (list 100 "acdbblockreference") (list 100 "acdbminsertblock") e))
[*] (entmake e)
[*] (entdel en)
[*] (command "explode" (entlast))
[*] )
[*])
[*])
express 工具里有个burst
[*];;例:(setq h (dxf1 ent 40)) ; ent 为实体名或实体entget,取得图元参数值内容----------(一级)------------------
[*](defun dxf1 (ent n)
[*](if (= (type ent) 'ename) (setq ent (entget ent)))
[*](cdr (assoc n ent))
[*])
[*]; ent 为实体名或实体entget,(setq ent (emod (entget (ssname ss 0)) 72 0))-更新图元定义数据内容--------(一级)----------------------------------
[*](defun emod (ent i n)
[*](if (= (type ent) 'ename) (setq ent (entget ent)))
[*](subst (cons i n) (assoc i ent) ent )
[*])
什么功能,炸开属性块保留属性文字吗 cghdy 发表于 2020-5-23 12:38
什么功能,炸开属性块保留属性文字吗
是,还有块 zzyong00 发表于 2020-5-23 22:26
express 工具里有个burst
那是不行的,都实验遍了 zzyong00 发表于 2020-5-23 22:26
express 工具里有个burst
那是不行的,都实验遍了 尘缘一生 发表于 2020-5-26 21:20
那是不行的,都实验遍了
哪里不行?什么结果?我们的都好用。
看看行不 请教这个代码怎么使用?我想批量选择属性块,批量分解
页:
[1]
2