Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change color of frozen layes

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
388 Views, 7 Replies

Change color of frozen layes

What would the lisp be to turn all "frozen and off " layers to color 9?

thanks!
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

Try attached Lisp.

Seems to work for me.

Bob
Message 3 of 8
Anonymous
in reply to: Anonymous

Sorry it did not seem to work - I created a fresh dwg and made a few layers
OFF and a few other layers frozen.
No changes occurred - here's the command line.....
= = = = =
Command: (load "c:/kd/kd-acad/kd-lisp/LISPLOAD")
C:LISPLOAD

Command: LISPLOAD
"C:\\KD\\Kd-acad\\kd-Lisp\\chg_layers_color_9.lsp" ; error: no function
definition: PROMP

Command:
Command: CHGLAY9
nil

Command:
= = = =
btw - I'm on acad2008
Message 4 of 8
Anonymous
in reply to: Anonymous

You said:
"what would the lisp be to turn all "frozen and off " layers to color 9?"...

Try Freezing (AND) turning Off .. a few test layers.
This Lisp checks for 'both' Frozen (and) Off states.

Bob
Message 5 of 8
Anonymous
in reply to: Anonymous

BTW,
IF you want to do 'or' Frozen / Off.. change this line:
(if (and (= l_freeze 1)(= l_on 0))
to be:
(if (or (= l_freeze 1)(= l_on 0))

Bob
Message 6 of 8
Anonymous
in reply to: Anonymous

This seems to work for me, in a quick test.

(vl-load-com)

(vlax-map-collection
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)))
'(lambda (x)
(if
(and
(= :vlax-true (vla-get-freeze x))
(= :vlax-false (vla-get-layeron x))
)
(vla-put-color x 9)
)
)
)

--
Autodesk Discussion Group Facilitator


"KDispoto" wrote in message
news:5782018@discussion.autodesk.com...
What would the lisp be to turn all "frozen and off " layers to color 9?

thanks!
Message 7 of 8
Anonymous
in reply to: Anonymous

After re-reading your post: In the code I posted
change the AND to OR.

--
Autodesk Discussion Group Facilitator


"Jason Piercey" wrote in message
news:5783269@discussion.autodesk.com...
(if
(and
(= :vlax-true (vla-get-freeze x))
(= :vlax-false (vla-get-layeron x))
)
Message 8 of 8
Anonymous
in reply to: Anonymous

Sorry for not responding sooner - as I had a deadline to deal with
yesterday.
Also sorry for the confusing wording - as I did mean 'or'.

The coding is more complicated than I thought but works nicely - I
appreciate all your help!

>>>HAPPY THANKSGIVING<<<


Thanks to all -
"Jason Piercey" wrote in message
news:5783284@discussion.autodesk.com...
After re-reading your post: In the code I posted
change the AND to OR.

--
Autodesk Discussion Group Facilitator


"Jason Piercey" wrote in message
news:5783269@discussion.autodesk.com...
(if
(and
(= :vlax-true (vla-get-freeze x))
(= :vlax-false (vla-get-layeron x))
)

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

Post to forums  

Autodesk Design & Make Report

”Boost