Lisp Routine to turn off layers by picking in drawing?

Lisp Routine to turn off layers by picking in drawing?

ctnycc
Advocate Advocate
2,188 Views
7 Replies
Message 1 of 8

Lisp Routine to turn off layers by picking in drawing?

ctnycc
Advocate
Advocate

Good day

 

Does anybody have a lisp routine which will turn off layers on picking them in the drawing?

 

Thanks in advance

 

Regards

 

Colin

 

0 Likes
Accepted solutions (2)
2,189 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant
Accepted solution

Better than just that, to either turn Off or Freeze the Layers of selected top-level or nested objects, check out LayerQuellPick.lsp, here.

Kent Cooper, AIA
0 Likes
Message 3 of 8

ctnycc
Advocate
Advocate
Accepted solution

Thannks Kent, sounds good, can't seem to find a file called  LayerQuellPick.lsp?

 

Colin

 

0 Likes
Message 4 of 8

ctnycc
Advocate
Advocate

its ok found it seemed to be downloadig wrong file duh!

0 Likes
Message 5 of 8

hencoop
Advisor
Advisor

I have a dialog app that I use.  I compiled it into a VLX for ease of delivery but I can package the lsp, dcl, etc. if you need that.

VLX attachments are not allowed here so I renamed it to Sholay.txt.  Be sure to rename it back to Sholay.VLX

I tested it on a "sterile" Acad session and this newly compiled file worked for me.  If it doesn't work for you just let me know.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 6 of 8

3wood
Advisor
Advisor

You can also try LF command in LAYER.vlx

0 Likes
Message 7 of 8

ctnycc
Advocate
Advocate

Hencoop

 

interesting command, will need ot look at this sometime to get the hang of it, i notice the help button doesn't respond.

 

Regards

 

Colin

 

 

0 Likes
Message 8 of 8

hencoop
Advisor
Advisor

There is no help file and the button has no action associated.  I put the button in there because I planned on creating one.  I never got around to it but I didn't take out the button.  Sorry.

 

The "Strip Keys" check box and the "Append" button are the only things that really need explaining.  Append is pretty simple.  You can append a string to a selected layer for use with the "Set" button which will then make the concatenated layer name if it does not exist.

 

There are a multitude of stand-alone layer macro commands in a supporting lisp file, lamacs.lsp, which is included with SHOLAY.VLX.

The "Strip Keys" check box is associated with a special set of user defined fields that I sometimes use in my layers names (see my CAD Layer Guidelines page for an explanation of "user defined"). Keys, when used, are the last five-characters at the end of a CLG format layer name that match the following wildcard string: "*-[SLPAER][DCVHL]##"  The 1st character is always the "-" separator.  Type KEY## at the command line to get a better idea of what this wildcard string represents.

 

If CLG format layer names are used then commands CLGMAJOR, CLGMINOR, CLGMODIF, and CLGUSER can be used to change each of those fields of an existing CLG layer respectively.  I have two modifications to the CLG fomat that I use which are CLGLTYPE and CLGCOLOR.  These make use of the first two "-" separator positions to designate linetype and color respectively.

 

The attached Keys.txt has a bit about what I call "Keys"

lamacs.txt is my autolisp file that contains all of the layer macros that I use.  The defuns for my "Key" functions are also in this file. It is compiled into SHOLAY so you don't need to load it to use the commands.

 

I should have mentioned that DOSLIB is used by some of my routines including SHOLAY.  It is a free download from Robert McNeel & Associates

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes