05-21-2019
01:29 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
05-21-2019
01:29 AM
@vporrash141089 wrote:
...
(if (setq sstext (ssget "_X" '((0 . "TEXT") (255,255,255)))); 255 text to color 7
(command "_.ChProp" ss "" "_C" 7 "")) ...
For TrueColors it's different code and also a different way of the description...
(if (setq sstext (ssget "_X" '((0 . "TEXT") (420 . 16777215)))) (command "_.ChProp" sstext "" "_C" 7 ""))
Next time, if you want to know the different color, set it to some object and use this line
(entget (car (entsel)))
and grab the code of 420.
The second one is a bit more advanced, so here is a function for that:
(defun BlockAttributeColorReplace (old new / ss i ent)
(if (setq ss (ssget "_A" (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'CTAB)))))
(repeat (setq i (sslength ss))
(setq ent (setq blk (ssname ss (setq i (1- i)))))
(while (/= "SEQEND" (cdr (assoc 0 (entget (setq ent (entnext ent))))))
(if (= old (cdr (assoc 62 (entget (setq ent (entnext ent))))))
(command "_.-attedit" "_yes" "" "" "" ent "_color" new "_next"))))))
The usage:
(BlockAttributeColorReplace 2 52)