Results 1 to 8 of 8

Thread: I want to turn all layers off except the current layer...

  1. #1
    Member
    Join Date
    2003-10
    Posts
    27
    Login to Give a bone
    0

    Default I want to turn all layers off except the current layer...

    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

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    Code:
    (progn
     (setvar "clayer" (getvar "ctab"))
     (command "_.layer" "_off" "*" "_No" "")
    )
    This will crash if the layer doesn't exist.

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    Code:
    (progn
      (if (tblsearch "LAYER" (getvar "ctab"))
        (command "vplayer" "f" "*" "c" "t" (getvar "ctab") "c" "")
      )
    )
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  4. #4
    Member Susie's Avatar
    Join Date
    2006-02
    Posts
    9
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    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

  5. #5
    Member
    Join Date
    2003-10
    Posts
    27
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    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.

  6. #6
    Member
    Join Date
    2003-10
    Posts
    27
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    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

  7. #7
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    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.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  8. #8
    Member
    Join Date
    2006-03
    Posts
    15
    Login to Give a bone
    0

    Default Re: I want to turn all layers off except the current layer...

    if you look at the express tool there is a standard command there.

    Hornet 103

Similar Threads

  1. Replies: 0
    Last Post: 2011-03-15, 05:44 PM
  2. Turn Off All Layers But Current - Lisp
    By omorah in forum AutoCAD Customization
    Replies: 3
    Last Post: 2009-10-01, 07:33 PM
  3. turn last pickpoint into current layer?
    By airick01 in forum AutoLISP
    Replies: 4
    Last Post: 2008-11-20, 12:22 AM
  4. Replies: 5
    Last Post: 2006-02-07, 02:14 AM
  5. Layer Control - Turn OFF several layers at once
    By TerryJones in forum AutoCAD General
    Replies: 10
    Last Post: 2005-10-26, 03:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •