插入的块后将块默认移至0图层,图层名称在第一行修改:![](source/plugin/imc_colorcode/images/loading.gif) - (defun c:TT (/ BLayNam Old_Cmd *ent*)
- (setq BLayNam "0");设置块插入的图层,默认为0图层
-
- (setq Old_Cmd (getvar "cmdecho"))(setvar "cmdecho" 0)
- (if (tblsearch "layer" BLayNam)
- (progn
- (initcommandversion)
- (command "insert" pause)
- (setq *ent* (entget (entlast)))
- (entmod (subst (cons 8 BLayNam) (assoc 8 *ent*) *ent*))
- )
- (princ (strcat "\n<" BLayNam ">图层名称不存在"))
- )
- (command "redraw")
- (setvar "cmdecho" Old_Cmd)
- (princ)
- )
|