本帖最后由 作者 于 2002-9-16 21:51:27 编辑
; convert all the elements of blocks into 0 layer;[br]; convert all the elements of blocks into 0 layer;
(defun blockconvert( blockname / bn en e)
(setq bn (tblobjname "block" blockname))
(setq en (entnext bn))
(while en
(setq e (entget en))
(setq e (subst (cons 8 "0") (assoc 8 e) e))
(if (assoc 62 e)
(setq e (subst (cons 62 256)(assoc 62 e) e))
)
(entmod e)
(setq en (entnext en))
)
(entupd bn)
)
(defun c:blockConvert(/ bname )
(ai_undo_push)
(setq bname (entsel "Select a block:"))
(setq bname (entget (car bname)))
(if (= "INSERT" (cdr (assoc 0 bname)))
(progn
(setq bname (cdr (assoc 2 bname)))
(blockconvert bname)
)
(princ "\nIt is not a block insert.")
)
(princ)
(ai_undo_pop)
)
最后要regen一下才能看到修改。
[此贴子已经被作者于2002-9-16 21:50:17编辑过] |