在CAD学习中,如何分解多重插入块的cad图纸?
1. 将以下程序复制到TXT文件中,然后另存为exm.lsp文件。保存如下图
CAD学习中磊教育
CAD学习中磊教育
2. 程序如下:
;;-------------------------------------------------------------
;;转换"多重插入块"为"普通块"。
(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)
)
3. 如图是"多重插入块"
CAD学习中磊教育
4. 第一步:加载刚保存的exm.lsp文件。