Autodesk Technology Managers Forum
Share your knowledge, ask questions, and engage with fellow CAD/BIM Managers.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 6
Anonymous
227 Views, 5 Replies

Global Color Change

I need a lisp routine that would change all the colors of all entities in a drawing (including nested blocks) to BYLayer without any dialog box popping out.

Thank you very much for your help.
5 REPLIES 5
Message 2 of 6
saluki
in reply to: Anonymous

These don't contain the magic bullet lisp you are looking for, but perhaps you could string together a couple of them, or at least get you going in the right direction.

Check out these threads . . .

http://discussion.autodesk.com/thread.jspa?messageID=1175110

http://discussion.autodesk.com/thread.jspa?messageID=2571733

http://discussion.autodesk.com/thread.jspa?messageID=1115314

good luck
Message 3 of 6
Anonymous
in reply to: Anonymous

Does this do what you want?

(defun C:CHGCO()

(SETVAR "CMDECHO" 0)
(COMMAND ".UCSICON" "ON")
(GRTEXT)
(GRTEXT -1 "Processing Blocks")
(GRTEXT -2 "Please Wait")
(SETQ P221 ""
CTR 1
L 0
COLSTN 0
D nil
BLTBL (TBLNEXT "BLOCK" T))
(WHILE (/= BLTBL nil)
(SETQ L (1+ L))
(SETQ COLTST 0
COLSTN 1
CURCHR "")
(SETQ BLNAM (CDR (ASSOC 2 BLTBL)))
;(GRTEXT -1 "Processing Block ")
;(GRTEXT -2 BLNAM)
(IF (= (CDR (ASSOC 1 BLTBL)) nil)
(PROGN
(SETQ BLLEN (STRLEN BLNAM))
(WHILE (< COLSTN BLLEN)
(SETQ CURCHR (SUBSTR BLNAM COLSTN 1))
(IF (= CURCHR "|")
(SETQ COLTST 1)
)
(SETQ COLSTN (1+ COLSTN))
)
(IF (/= COLTST 1)
(PROGN
(SETQ BNELST (CDR (ASSOC -2 BLTBL)))
(WHILE (/= BNELST nil)
(SETQ ELST (ENTGET BNELST))
(SETQ NELST (SUBST (CONS 62 0) (ASSOC 62 ELST) ELST))
(ENTMOD NELST)
(SETQ BNELST (ENTNEXT BNELST))
)
)
)
)
)
(SETQ BLTBL (TBLNEXT "BLOCK"))

)
(GRTEXT -1 "Building Entity List")
(GRTEXT -2 "Please Wait")
(setq enam (entnext)
ctr 1)
(while (/= enam nil)
(setq enam (entnext enam))
(setq ctr (1+ ctr))
(grtext 0 (rtos ctr 2 4))
)
(SETQ ENAM (ENTNEXT))
(SETQ D CTR)
(if (/= ENAM NIL)
(progn
(setq L 0
CTR 1
P221 ""
tck 2)
(GRTEXT 0 (rtos d 2 0))
(while (/= ENAM NIL)
;(CTRMES) **REMOVED 5/12/03 by MPK to allow for dwgs with
less than 20 ents.
(GRTEXT 1 (rtos L 2 0))
(IF (= TCK 12) (SETQ TCK 2))
(GRTEXT TCK "Changing")
(GRTEXT TCK "Changing" 1)
(SETQ ELST (ENTGET ENAM))
(if (/= (cdr (assoc 0 elst)) "ATTDEF")
(progn
(setq NELST (subst (cons 62 256) (assoc 62 ELST)
ELST))
)
(progn
(setq NELST (subst (cons 62 0) (assoc 62 ELST)
ELST))
)
)
(ENTMOD NELST)
(ENTUPD ENAM)
(setq suen (cdr (assoc 66 nelst)))
(setq l (1+ l))
(setq tck (1+ tck))
(SETQ ENAM (ENTNEXT ENAM))
)
)
(princ "None Found.")
)
(GRTEXT)
)
Message 4 of 6
Anonymous
in reply to: Anonymous

a better routine would be a object dbx that does this for a directory and
all sub directories

--
Dave

wrote in message news:5242621@discussion.autodesk.com...
I need a lisp routine that would change all the colors of all entities in a
drawing (including nested blocks) to BYLayer without any dialog box popping
out.

Thank you very much for your help.
Message 5 of 6
Anonymous
in reply to: Anonymous

Do you want it?
"David Allen" wrote in message
news:5245251@discussion.autodesk.com...
a better routine would be a object dbx that does this for a directory and
all sub directories

--
Dave

wrote in message news:5242621@discussion.autodesk.com...
I need a lisp routine that would change all the colors of all entities in a
drawing (including nested blocks) to BYLayer without any dialog box popping
out.

Thank you very much for your help.
Message 6 of 6
Anonymous
in reply to: Anonymous

rudy?

--
Dave

"Curious George" wrote in message
news:5246340@discussion.autodesk.com...
Do you want it?
"David Allen" wrote in message
news:5245251@discussion.autodesk.com...
a better routine would be a object dbx that does this for a directory and
all sub directories

--
Dave

wrote in message news:5242621@discussion.autodesk.com...
I need a lisp routine that would change all the colors of all entities in a
drawing (including nested blocks) to BYLayer without any dialog box popping
out.

Thank you very much for your help.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Administrator Productivity


Autodesk Design & Make Report