PDA

View Full Version : I want to turn all layers off except the current layer...


droak
2006-03-13, 08:18 PM
I have inserted dozens of images into a drawing and created layers with those image names and created layouts for each of the layers.

I would like to turn off all the layers except the layer which is named the same as the layout name.

I can do this in the Layer Properties Manager Dialog box, by turning off the Current VP Freeze Icon. But, I don't see the option on the command line.

How would I enter a line of code to set this option?

Darrell

T.Willey
2006-03-13, 08:30 PM
(progn
(setvar "clayer" (getvar "ctab"))
(command "_.layer" "_off" "*" "_No" "")
)

This will crash if the layer doesn't exist.

Opie
2006-03-13, 08:33 PM
(progn
(if (tblsearch "LAYER" (getvar "ctab"))
(command "vplayer" "f" "*" "c" "t" (getvar "ctab") "c" "")
)
)

Susie
2006-03-13, 10:33 PM
Hi!
If you are a huge Toolbar user, just make a couple of buttons on one of your toolbars.
That way you do not have to use the keyboard all the time.
You can go in to customize and do ^C^C_-layer off on one button, * on another and
grab the dark lightbulb from the "All Commands" box to put on the toolbar.
That way, you just have to remember the command and switch. (* means "All" and ^C^C cancels out the previous command, etc.
There is a list in the Help file somewhere of these switches.
You can edit your button image any way you want.
Some of my buttons are short. They just have Y for "yes" and P for "Previous" next to the commands I use them with.
Susie

droak
2006-03-14, 12:47 PM
I applologize, I used the wrong terminology.

I want to freeze all layers except the current layer. I don't want to turn them off.

droak
2006-03-14, 02:23 PM
Opie:

I like your code and I'll use it in another application.

The problem with this code is, it freezes the layers. I need to freeze the layers in the view ports "only".

Do you have any thought about this.

Darrell

Opie
2006-03-15, 02:35 AM
This freezes the layers in the current viewport. If you are in paper space, but not in a viewport, it will freeze all the layers in paperspace. To freeze in a desired viewport, make that one active. My code doesn't go any further than that.

hevgee
2006-03-15, 09:30 AM
if you look at the express tool there is a standard command there.

Hornet 103