jim78b
Guest
ciao, ho un lisp che mette tutti i colori su byblock anche nei blocchi nidificati ma mis on accorto oggi che con i colori rgb non li cambia proprio (intendo se in un blocco lo edito e metto le entità su un colore rgb es 245,0,0 e poi esco dal blocco e lancio il lisp non mi mette le entità su byblock....se riuscite a corregere la routine grazie
(defun c:setbyblock ( / _byblock e )
(defun _byblock ( n l / a e x )
(if (and
(setq e (tblobjname "block" n))
(not (member n l))
)
(while (setq e (entnext e))
(if (setq a (assoc 62 (setq x (entget e))))
(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
)
(while
(progn (setvar 'errno 0) (setq e (car (entsel "\nselect block: ")))
(cond
( (= 7 (getvar 'errno))
(princ "\nmissed, try again.")
)
( (= 'ename (type e))
(if (= "insert" (cdr (assoc 0 (entget e))))
(_byblock (cdr (assoc 2 (entget e))) nil)
(princ "\nobject is not a block.")
)
)
)
)
)
(command "_.regen")
(princ)
)
(defun c:setbyblock ( / _byblock e )
(defun _byblock ( n l / a e x )
(if (and
(setq e (tblobjname "block" n))
(not (member n l))
)
(while (setq e (entnext e))
(if (setq a (assoc 62 (setq x (entget e))))
(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
)
(while
(progn (setvar 'errno 0) (setq e (car (entsel "\nselect block: ")))
(cond
( (= 7 (getvar 'errno))
(princ "\nmissed, try again.")
)
( (= 'ename (type e))
(if (= "insert" (cdr (assoc 0 (entget e))))
(_byblock (cdr (assoc 2 (entget e))) nil)
(princ "\nobject is not a block.")
)
)
)
)
)
(command "_.regen")
(princ)
)