Layoff - Block/Entity selection - Script vs Macro vs LISP

Layoff - Block/Entity selection - Script vs Macro vs LISP

ZXLVV
Explorer Explorer
484 Views
2 Replies
Message 1 of 3

Layoff - Block/Entity selection - Script vs Macro vs LISP

ZXLVV
Explorer
Explorer

Between using scripts, macros or LISP - Can someone please suggest the easiest approach to create a simple "script" in AutoCAD. I'm using AutoCAD MEP but assuming it would apply to any flavor of AutoCAD. 

 

I'm looking to toggle between "block" or "entity" selection settings when using the LAYOFF command.

Doing it manually requires numerous entries for such a commonly-used change.

 

Lastly, and most importantly, how can I create a shortcut (or alias) to run either script.

 

I tried using the following script to achieve that, but running a script via the SCR command and selecting each script takes as long as typing manually in command line:

 

ZXLVV_0-1652384945242.png

 

 

ZXLVV_1-1652384999136.png

 

Thanks in advance.

 

0 Likes
485 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant

How do you run LAYOFF right now?

 

I prefer to have two sets of icons...

BeekeeCZ_0-1652724093182.png

 

0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

You may be able to use LayerQuellPick.lsp, >here<, which defines a command called LOP [= Layer Off by Pick], and one called LOPN [= Layer Off by Pick, Nested].  Under LOP, if you pick anywhere on a Block, it will turn off the Layer the Block is inserted on, regardless of the Layer of the part of it you picked on.  Under LOPN, it will turn off the Layer of the nested object within it [the deepest-nested Layer other than 0, so for Block parts drawn on Layer 0, it turns off the Layer it "looks" like the nested object is on].  You can use LFP and LFPN to Freeze the Layer instead of turning it Off.

 

You can put those in Tool Palette buttons, type in those command names, or even if you prefer put them into Scripts [though using those would be more work, as you say, unless you build Tool Palette buttons that call them as Scripts].

Kent Cooper, AIA
0 Likes