[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Quickly Freeze and Turn Off Layers
Tip# 3814 By Kent Cooper On 18-Feb-2012
Rated By 1 users Downloaded : 840
Categories : Display Properties, Layer Properties
Software type : AutoCAD 2012
Rename File To : LayerQuellPick.lsp
Four quick functions will help you handle layer visibility.

A recently published CAD Tip, No. 3755, allows you to select layers to freeze and if you choose the current layer, it switches the current layer to layer 0, allowing you to continue. Kent Cooper has added more functionality to this idea by allowing you to pick layer 0 to freeze it, in which case another layer will be set to current. This routine also include a function to automatically select the layer of nested entities. Lastly, there are a set of functions that perform the same operations, except they will turn off the selected layer instead of freezing it. Load the LISP file and the following functions will be available:

  • LOP — Turns off selected top-level layer
  • LOPN — Turns off selected nested layer
  • LFP — Freezes selected top-level layer
  • LFPN — Freezes selected nested layer.



Average Rating:

User comments
Comment by Cooper,Kent
Posted on 2012-02-20 14:01:11
What the command names stand for: LOP = Layer Off by Picking object; LOPN = Layer Off by Picking object or Nested object; LFP = Layer Freeze by Picking object; LFPN = Layer Freeze by Picking object or Nested object. Nested-object commands work on top-level objects if you pick something that is not nested. [That's also true of Tip 3755, which also has both top-level and nested-object commands, though only for freezing.] They repeat as long as you keep picking, to turn off or freeze multiple Layers in one invocation. For nested objects, they recognize that a Layer-0 element in a Block/Xref "appears" on the Layer on which the Block/Xref is inserted, and that it will be that Layer you want to turn off or freeze, so they find that Layer rather than doing it to Layer 0.
Comment by Cooper,Kent
Posted on 2016-07-16 08:35:12
At the request of someone at the AutoCAD Customization Forum, here's a version that allows you to select multiple objects, either beforehand or within the command, to be either turned Off (LOM command) or Frozen (LFM). Since you can't pre-select nested objects, this doesn't have the nested-object options that the pick-one-at-a-time LOPN & LFPN commands do.
Comment by Cooper,Kent
Posted on 2017-02-20 16:14:07
Also at the request of someone at the AutoCAD Customization Forum, here's a version that adds Locking commands in addition to turning Off and Freezing: LLP [= Layer LOCK by Picking (top-level only)] and LLPN [= Layer LOCK by Picking (top-level or) Nested objects]. See commentary at the top of the file for differences from AutoCAD's LAYLCK command.