如题所述
以下代码来自于网络:
(DEFUN C:exm ()
(setvar "cmdecho" 0)
(SETQ STM (car (ENTSEL "\n点取多重块")))
(while stm
(setq e (entget stm))
(setq stlx (cdr (assoc 0 e)))
(if (= stlx "INSERT")
(PROGN
(setq r_zm70 (assoc 70 e))
(setq c_zm71 (assoc 71 e))
(setq r_dist_zm44 (assoc 44 e))
(setq c_dist_zm45 (assoc 45 e))
(setq e (subst (cons 44 0) r_dist_zm44 e))
(setq e (subst (cons 45 0) c_dist_zm45 e))
(setq e (subst (cons 70 0) r_zm70 e))
(setq e (subst (cons 71 0) c_zm71 e))
(setq e (subst (list 100"AcDbBlockReference") (list 100"AcDbMInsertBlock") e))
(entmake e)
(entdel stm)
))
(SETQ STM (car (ENTSEL "\n点取下一多重块")))
)
(setvar "cmdecho" 1)
)
将上面的代码复制,粘贴到文本编辑器里面,保存为后缀名为.lsp格式的,在cad工具-加载应用程序,找到你保存的这个文件,输入exm,然后就选择两此不能分解的多重块,就变成可以分解的普通块了。
祝你生活愉快。。。
(DEFUN C:exm ()
(setvar "cmdecho" 0)
(SETQ STM (car (ENTSEL "\n点取多重块")))
(while stm
(setq e (entget stm))
(setq stlx (cdr (assoc 0 e)))
(if (= stlx "INSERT")
(PROGN
(setq r_zm70 (assoc 70 e))
(setq c_zm71 (assoc 71 e))
(setq r_dist_zm44 (assoc 44 e))
(setq c_dist_zm45 (assoc 45 e))
(setq e (subst (cons 44 0) r_dist_zm44 e))
(setq e (subst (cons 45 0) c_dist_zm45 e))
(setq e (subst (cons 70 0) r_zm70 e))
(setq e (subst (cons 71 0) c_zm71 e))
(setq e (subst (list 100"AcDbBlockReference") (list 100"AcDbMInsertBlock") e))
(entmake e)
(entdel stm)
))
(SETQ STM (car (ENTSEL "\n点取下一多重块")))
)
(setvar "cmdecho" 1)
)
将上面的代码复制,粘贴到文本编辑器里面,保存为后缀名为.lsp格式的,在cad工具-加载应用程序,找到你保存的这个文件,输入exm,然后就选择两此不能分解的多重块,就变成可以分解的普通块了。
祝你生活愉快。。。
温馨提示:答案为网友推荐,仅供参考
第1个回答 2017-05-18
(defun c:unlk (/ en ent)
(setq en (entsel "\n请选择被加密的图形:"))
(if en
(if (= (cdr (assoc 0 (setq ent (cdr (entget (setq en (car en)))))))
"INSERT"
)
(progn
(setq ent (entmakex
(list '(0 . "INSERT")
(assoc 2 ent)
(assoc 10 ent)
)
)
)
(command "_.explode" (entlast))
(entdel en)
)
)
)
(princ "\nOK,解密成功。")
(princ)
)
(setq en (entsel "\n请选择被加密的图形:"))
(if en
(if (= (cdr (assoc 0 (setq ent (cdr (entget (setq en (car en)))))))
"INSERT"
)
(progn
(setq ent (entmakex
(list '(0 . "INSERT")
(assoc 2 ent)
(assoc 10 ent)
)
)
)
(command "_.explode" (entlast))
(entdel en)
)
)
)
(princ "\nOK,解密成功。")
(princ)
)