Freeze all layers except pick

Freeze all layers except pick

johnw
Collaborator Collaborator
14,773 Views
25 Replies
Message 1 of 26

Freeze all layers except pick

johnw
Collaborator
Collaborator

I've attached a routine that freezes the layer that you pick. I need to reverse it so whatever entity's layer you pick it becomes current and all other layers freeze EXCEPT the one picked.

 

Any help would be appreciated.

 

Thanks,

 

John

0 Likes
Accepted solutions (1)
14,774 Views
25 Replies
Replies (25)
Message 2 of 26

Kent1Cooper
Consultant
Consultant
Accepted solution

Here you go.  Its LIT command [= Layer Isolate as to Thaw/Freeze condition only] is similar to AutoCAD's LAYISO with some important differences beyond just that it Freezes rather than turns Off the Layer(s) on which nothing was selected [see the related Tip referred to].  And it has the corresponding LUT command that operates similarly to LAYUNISO with those same differences.  [You can pick things on more than one Layer if you want -- if you do, one of those Layers will become current, though you may not be able to control which one.]

 

EDIT:  Downloading it at the linked site is currently not working.  See Message 23 here.

Kent Cooper, AIA
Message 3 of 26

Anonymous
Not applicable

Hi,

There is no LIT or LUT command in my AutoCAD 2019. Did they remove it or what’s happening? Thanks. 

0 Likes
Message 4 of 26

dlanorh
Advisor
Advisor

They are not AutoCAD commands, but commands available when the lisp program found by clicking on the underlined HERE in @Kent1Cooper 's post is loaded.

I am not one of the robots you're looking for

0 Likes
Message 5 of 26

Anonymous
Not applicable

I’m new to Autocad. Where is the lisp file with the command to uploaded then? I would definitely like to freeze all the layers at once and keep only one on than going through 15 layers one by one and freeze. Help me out. Thanks

0 Likes
Message 6 of 26

Anonymous
Not applicable

Oh, ok then. I just scrolled up the page and found the file attached. 😁 Never mind. 

0 Likes
Message 7 of 26

dlanorh
Advisor
Advisor

Click on the Blue underlined HERE in post 2. This will take you to where you can download or copy the lisp.

I am not one of the robots you're looking for

0 Likes
Message 8 of 26

Anonymous
Not applicable

For the record, I cannot click on the link HERE you provided. For some reason doesn’t behave like a link but just like a word in the sentence. I just downloaded the Freezlay.lsp file above, uploaded in my AC...but, what's the command to use or how do I use lisp files? I tried LIT, LUT, FreezLay all sorts of combinations in the command line and nothing happened. 

0 Likes
Message 9 of 26

dlanorh
Advisor
Advisor

Click on the HERE link in post No 2, not my post. To run the lisp you have downloaded you need to type FF, but it doesn't work very well, hence the ask for help which was answered in post 2 by @Kent1Cooper 

I am not one of the robots you're looking for

0 Likes
Message 10 of 26

Anonymous
Not applicable

Oh 😁 that works. My bad, sorry. I lack reading comprehension. I never had it. But hear me on this now. Indeed the lisp works with FF in command line, and thank you for that. What’s the point of this lisp file if it does what LAYFRZ command in AC does? Actually LAYFRZ does it quicker because the object disappear just by clicking on it. With the lisp file you have to click and press Enter to freeze, one extra step. I was expecting to click on an object in my drawing press Enter and everything else to freeze, but the one I highlighted. It freezes the object I click on which doesn’t do any good... for me.

0 Likes
Message 11 of 26

Anonymous
Not applicable

But it wasn’t all in vain though. I learnt something this morning which I greatly appreciate. Next time when I download a lisp file I will open it up with the text file editor to see what’s the freaking command line for it, 😁, thanks to you...and the one who wrote the file. My sincere respect and thank you for helping me out.

Message 12 of 26

dlanorh
Advisor
Advisor
It is either a throwback to pre 2000 or the programmer is learning how to write lisps.

I am not one of the robots you're looking for

0 Likes
Message 13 of 26

Anonymous
Not applicable

Believe it or not I just discovered the lisp file written by Kent has a use. The LAYFRZ command in AC will not allow me to freeze an entire object made of several blocks placed on several layers. I have to click on every block individually to disappear. In Settings for LAYFRZ is not an option for it. Now the FRELAYER. LISP actually does it...which is quite valuable now. Probably this is what the author meant with it. After that LAYTHW command unfreezes back everything. It’s worth keeping it.

0 Likes
Message 14 of 26

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... Indeed the lisp [at Message 1]works with FF in command line, and thank you for that. What’s the point of this lisp file if it does what LAYFRZ command in AC does? .... I was expecting to click on an object in my drawing press Enter and everything else to freeze, but the one I highlighted. It freezes the object I click on which doesn’t do any good... for me.


 

Go back and re-read the Message itself at Message 1.  They didn't attach a routine that did what they wanted, but one that did the opposite, as an example of something they wanted the reverse of.  Mine in Message 2 was made to do exactly what you were expecting, except for letting you pick things on more than one  Layer to remain thawed, which is the thaw/freeze equivalent of the way LAYISO works for the off/on condition.

 

[LAYFRZ probably didn't exist in AutoCAD yet at the time that code attached in Message 1 was written, so there was indeed a point to it.]

Kent Cooper, AIA
0 Likes
Message 15 of 26

Anonymous
Not applicable

Kent, I posted a message before explaining that your code actually does something quite valuable which LAYFRZ doesn’t even with AC 2019, allowing the selection of all the blocks in an object and freeze them all at once. Quite valuable lisp. Thank you for writing it. 

0 Likes
Message 16 of 26

Anonymous
Not applicable

Please tell me how to have your lisp loaded all the time in my AC. Every time I quit the prog the lisp gets unloaded. What do I have to do? Thank you.

0 Likes
Message 17 of 26

Kent1Cooper
Consultant
Consultant

 


@Anonymous wrote:

Please tell me how to have your lisp loaded all the time in my AC. Every time I quit the prog the lisp gets unloaded. What do I have to do? Thank you.


 

Open up a plain-text editor such as Notepad.  In it, put this line:

 

(load "LayerIsolateThawFreeze")

 

OR  this line:

 

(autoload "LayerIsolateThawFreeze" '("LIT" "LUT"))

 

Save that to a file called acaddoc.lsp, in any logical-looking folder [most likely one with "support" in the name] that is in the Support File Search Path list, in the Files tab, in the OPTIONS command dialog box.

 

Whatever is in a file of that name [you can add more lines with other routines you want loaded] gets done in every drawing you open, new or existing.  If you use the first one [the (load) function], it will be loaded outright, and the commands in it just plain defined.  If you use the second [the (autoload) function], it will have its command names "flagged" to be available, but the code itself won't get loaded unless and until  you call for one of those commands.  The latter approach can save some time in opening up drawings if you eventually have a lot of such things listed in the acaddoc.lsp file.

Kent Cooper, AIA
0 Likes
Message 18 of 26

dlanorh
Advisor
Advisor
Type APPLOAD on the command line. This should bring up a dialog. Somewhere on the dialog there will be a briefcase icon for STARTUP SUITE and a CONTENTS button under it. Press this, then ADD then browse to where the lisp is saved. Once added it should load everytime.

I am not one of the robots you're looking for

0 Likes
Message 19 of 26

Anonymous
Not applicable

Thank you, I’m doing it right now. 

0 Likes
Message 20 of 26

Anonymous
Not applicable

Thank you, I’m doing it right now.

0 Likes