Jump to content

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


Recommended Posts

Posted

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.

Posted

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.

Posted

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.

 

(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.

 

; 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"

Posted

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

 

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.

 

(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.

 

; 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"

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...