你好,我有这个代码,我需要修改块内的颜色。
- (defun c:setbyblock ( / _byblock e n x a sel c)
-
- (defun _byblock ( n l / a e x )
- (if (and (setq e (tblobjname "BLOCK" n)) (not (member n l)))
- (while (setq e (entnext e))
- (setq x (entget e))
- (if (setq a (assoc 420 x))
- (setq x (vl-remove (assoc 420 x) x))
- )
- (if (setq a (assoc 62 x))
- (entmod (subst '(62 . 0) a x))
- (entmod (append x '((62 . 0))))
- )
- (if (= "INSERT" (cdr (assoc 0 x)))
- (_byblock (cdr (assoc 2 x)) (cons n l))
- )
- )
- )
- nil
- )
-
- (prompt "\nSelect Blocks: ")
- (setq sel (ssget (list (cons 0 "INSERT"))))
- (setq c 0)
- (repeat (sslength sel)
- (setq n (ssname sel c))
- (_byblock (cdr (assoc 2 (entget n))) nil)
- (setq c (1+ c))
- )
-
- (command "_.regen")
- (princ)
-
- )
大家帮忙看看,谢谢 |