+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Junior Member
    Using
    Civil 3D 2011
    Join Date
    Sep 2011
    Posts
    19

    Default lisp request: turn all off layers on, click the layers you would like to stay on

    Registered forum members do not see this ad.

    I used to have this really handy lisp but have switched companies and forgot to bring it with me.

    The command was LPO and it would turn every off layer on, even xref, and I would be able to individually click the layers that I wanted to remain on. After clicking enter, the other layers would return to the off state. One of the most useful routines I have ever seen.

    I have very basic knowledge of lisp around would really appreciate some help.

    I also did a search and couldn't find anything similar.

    Thanks in advanced.

  2. #2
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    841

    Default

    Sounds like Kent Kooper's Layer Isolate/Unisolate. But I'm not sure does it work with xrefs.

  3. #3
    Junior Member
    Using
    Civil 3D 2011
    Join Date
    Sep 2011
    Posts
    19

    Default

    Quote Originally Posted by Grrr View Post
    Sounds like Kent Kooper's Layer Isolate/Unisolate. But I'm not sure does it work with xrefs.
    It was actually sort of the reverse of that. I happen to have an old gif of the command.

    http://i.imgur.com/8z32cUr.gifv

  4. #4
    Junior Member
    Using
    Civil 3D 2011
    Join Date
    Sep 2011
    Posts
    19

    Default

    You would issue the command and it would turn everything that's "off" to "on". Then you could select individual layers with your mouse that would stay "on". The rest of the original off layers would return to the "off" state.

  5. #5
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    8,912

    Default

    If you look at this snippet of code it shows the layer details, no code at this stage someone may have something not a hard task why not have a go yourself.

    Code:
    (setq doc (vla-get-activedocument (vlax-get-acad-object)))
    (setq alllayers (vla-get-layers doc))
    (vlax-for lay alllayers
    (vlax-dump-object lay)
    )
    Look at the dump you will see the on/off freez/thaw switches so a list can be made of existing condition.

    Code:
    ; IAcadLayer: A logical grouping of data, similar to transparent acetate overlays on a drawing
    ; Property values:
    ;   Description = ""
    ;   Freeze = 0
    ;   LayerOn = -1
    ;   Linetype = "Continuous"
    ;   Lineweight = -3
    ;   Lock = 0
    ;   Material = "Global"
    ;   Name = "0"
    ;   PlotStyleName = "Color_7"
    ; IAcadLayer: A logical grouping of data, similar to transparent acetate overlays on a drawing
    ; Property values:
    ;   Description = ""
    ;   Freeze = -1
    ;   LayerOn = -1
    ;   Linetype = "Continuous"
    ;   Lineweight = -3
    ;   Lock = 0
    ;   Material = "Global"
    ;   Name = "alan1freeze"
    ;   PlotStyleName = "Color_7"
    ;   Plottable = -1
    ; IAcadLayer: A logical grouping of data, similar to transparent acetate overlays on a drawing
    ; Property values:
    ;   Description = ""
    ;   Freeze = 0
    ;   LayerOn = 0
    ;   Linetype = "Continuous"
    ;   Lineweight = -3
    ;   Lock = 0
    ;   Material = "Global"
    ;   Name = "alan2off"
    A man who never made mistakes never made anything

  6. #6
    Junior Member
    Using
    Civil 3D 2011
    Join Date
    Sep 2011
    Posts
    19

    Default

    I wish my knowlage of lisp was as great as most others on this board. This is making me dizzy.

    Quote Originally Posted by BIGAL View Post
    If you look at this snippet of code it shows the layer details, no code at this stage someone may have something not a hard task why not have a go yourself.

    Code:
    (setq doc (vla-get-activedocument (vlax-get-acad-object)))
    (setq alllayers (vla-get-layers doc))
    (vlax-for lay alllayers
    (vlax-dump-object lay)
    )
    Look at the dump you will see the on/off freez/thaw switches so a list can be made of existing condition.

    Code:
    ; IAcadLayer: A logical grouping of data, similar to transparent acetate overlays on a drawing
    ; Property values:
    ;   Description = ""
    ;   Freeze = 0
    ;   LayerOn = -1
    ;   Linetype = "Continuous"
    ;   Lineweight = -3
    ;   Lock = 0
    ;   Material = "Global"
    ;   Name = "0"
    ;   PlotStyleName = "Color_7"
    ; IAcadLayer: A logical grouping of data, similar to transparent acetate overlays on a drawing
    ; Property values:
    ;   Description = ""
    ;   Freeze = -1
    ;   LayerOn = -1
    ;   Linetype = "Continuous"
    ;   Lineweight = -3
    ;   Lock = 0
    ;   Material = "Global"
    ;   Name = "alan1freeze"
    ;   PlotStyleName = "Color_7"
    ;   Plottable = -1
    ; IAcadLayer: A logical grouping of data, similar to transparent acetate overlays on a drawing
    ; Property values:
    ;   Description = ""
    ;   Freeze = 0
    ;   LayerOn = 0
    ;   Linetype = "Continuous"
    ;   Lineweight = -3
    ;   Lock = 0
    ;   Material = "Global"
    ;   Name = "alan2off"

  7. #7
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    8,912

    Default

    Registered forum members do not see this ad.

    I am sure there is a lisp "save current layer settings" something I dont have. Next step is to reset the Freeze & Layeron settings do your bit then reset layers back to the way they were. Maybe on the week end I will have time
    A man who never made mistakes never made anything

Similar Threads

  1. Turn off non-plottable layers with Lisp
    By Tom_D in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 21st Oct 2014, 08:49 pm
  2. Empty layers, Hide Turn off or (Show only layers that contain objects)
    By PSAPmapR in forum AutoCAD Drawing Management & Output
    Replies: 11
    Last Post: 18th Nov 2013, 04:14 pm
  3. X-Ref Layers Don't Stay Frozen Or Off
    By jmn41283 in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 3rd Feb 2012, 07:44 pm
  4. Layers in drawing won't stay on/off
    By 92dore in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 10th Aug 2005, 10:35 pm
  5. Help with a lisp routine to turn layers ON/OFF
    By neilma in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 19th Feb 2004, 09:05 pm

Tags for this Thread

Bookmarks

Posting Permissions

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