<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hide all but the current layer in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193759#M45115</link>
    <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would like to hide all layers except the current layer.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Is the only way to do this in lisp is to use vla-get-layers and vla-get-count to hide all layers individually?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Also, after the process is finished, I need to restore all the layers to their original state.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is it still the same procedure to switch them back to visible?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 26 May 2022 01:00:23 GMT</pubDate>
    <dc:creator>saitoib</dc:creator>
    <dc:date>2022-05-26T01:00:23Z</dc:date>
    <item>
      <title>Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193759#M45115</link>
      <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would like to hide all layers except the current layer.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Is the only way to do this in lisp is to use vla-get-layers and vla-get-count to hide all layers individually?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Also, after the process is finished, I need to restore all the layers to their original state.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is it still the same procedure to switch them back to visible?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 May 2022 01:00:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193759#M45115</guid>
      <dc:creator>saitoib</dc:creator>
      <dc:date>2022-05-26T01:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193785#M45116</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5108811"&gt;@saitoib&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you can't freeze the current layer using the -layer command, you can just...&lt;/P&gt;
&lt;P&gt;-layer _F *&lt;/P&gt;
&lt;P&gt;To get them back to where they all were, I suggest you use Layer Manager before you freeze *.&lt;/P&gt;
&lt;P&gt;I think that most users use OFF for temporary purposes, and when done with their contrivances they just turn them all back ON, none of which affects their freeze/thaw states.&amp;nbsp; BUT you CAN turn OFF the current layer, so be careful.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 01:15:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193785#M45116</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2022-05-26T01:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193841#M45117</link>
      <description>&lt;P&gt;Why not use Layiso that is what that function is for.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 01:47:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11193841#M45117</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-05-26T01:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194118#M45118</link>
      <description>&lt;P&gt;Here you have it with some bonus functions that I use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(setq layer_ON_OFF_list '("Layer1" "Layer2" "Layer3"))
;create DCL selection for initializing global variable

(defun Table (s / d r)
	(while (setq d (tblnext s (null d)))
		(setq r (cons (cdr (assoc 2 d)) r))
	)
)

;Hides all layers that are stored in layer_ON_OFF_list
(defun C:LOFF (/ layobj)
  (foreach layname layer_ON_OFF_list  ; add as many as you like
    (if (setq layobj (tblobjname "layer" layname))
       (vla-put-LayerOn (vlax-ename-&amp;gt;vla-object layobj) 0)
    )
  )
  (princ)
)

;Shows all layers that were hidden (stored in layer_ON_OFF_list)
(defun C:LON (/ layobj)
  (foreach layname layer_ON_OFF_list  ; add as many as you like
    (if (setq layobj (tblobjname "layer" layname))
       (vla-put-LayerOn (vlax-ename-&amp;gt;vla-object layobj) 1)
    )
  )
  (princ)
)

;hide all but current layer
(defun c:habc ()
	(foreach layobj (Table "layer")
		(if (/= layobj (getvar 'clayer))
			(vla-put-LayerOn (vlax-ename-&amp;gt;vla-object (tblobjname "layer" layobj)) 0)
		)
	)
	(princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create&amp;nbsp; yourself function that turns on all layer based on this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 06:35:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194118#M45118</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2022-05-26T06:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194204#M45119</link>
      <description>&lt;P&gt;I can only recommend using Kent's Layer Isolation routine that I use daily for more than a decade.&lt;/P&gt;
&lt;P&gt;I'll share my little modified version, differences are described lower.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;;; Added Lock/unlock Isolation [command name: LIL, LUO-same command for both]&lt;BR /&gt;;; Added Isolation of current layer if nothing selected before (PICKFIRST=1)&lt;BR /&gt;;; Changed behavior when current layer is turning off. Now a layer of the first selected object is made current.&lt;BR /&gt;;; Beekeeper, January 2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;;; LayerIsolateOnOff.lsp [command names: LIO, LUO]&lt;BR /&gt;;; To Isolate and Unisolate only the On-Off condition of Layers of selected objects.&lt;BR /&gt;;; LIO isolates Layers of selected objects, leaving those Layers on and turning all&lt;BR /&gt;;; other Layers off that are not already off. If repeated before LUO turns those&lt;BR /&gt;;; Layers back on, makes further isolations, to as many levels as desired.&lt;BR /&gt;;; LUO turns latest set of turned-off Layers back on, without undoing other Layer&lt;BR /&gt;;; options that may have been used under isolated conditions [as happens with&lt;BR /&gt;;; some (e.g. colors) if using AutoCAD's standard LAYERUNISO to return to un-&lt;BR /&gt;;; isolated conditions after using LAYISO]. When repeated, steps back through&lt;BR /&gt;;; as many isolations as were done with LIO [LAYISO can only step back once].&lt;BR /&gt;;; Kent Cooper, August 2011&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 07:47:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194204#M45119</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-05-26T07:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194439#M45120</link>
      <description>&lt;P&gt;Thank you all for your guidance!&lt;/P&gt;&lt;P&gt;I have received a lot of guidance and I need some time to understand it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 09:59:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194439#M45120</guid>
      <dc:creator>saitoib</dc:creator>
      <dc:date>2022-05-26T09:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194592#M45121</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5108811"&gt;@saitoib&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;SPAN&gt;I would like to hide all layers except the current layer.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;....&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;after the process is finished, I need to restore all the layers to their original state. ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;, thanks for the reference, but [the original] LIO requires picking something(s).&amp;nbsp; Your modification to isolate the current Layer appears to require that when you want to isolate the Layers of selected things, it is necessary to select them first, unlike virtually any other command, so I don't think I'd go for that approach -- I'd be sure to sometimes put in the command name without pre-selection as I can for other commands, and then the ones I wanted to isolate wouldn't be visible to select [unless the current Layer was one of them].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about just this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;(defun C:&lt;FONT color="#0000FF"&gt;LOABC&lt;/FONT&gt; () ; = &lt;FONT color="#0000FF"&gt;L&lt;/FONT&gt;ayers &lt;FONT color="#0000FF"&gt;O&lt;/FONT&gt;ff &lt;FONT color="#0000FF"&gt;A&lt;/FONT&gt;ll &lt;FONT color="#0000FF"&gt;B&lt;/FONT&gt;ut &lt;FONT color="#0000FF"&gt;C&lt;/FONT&gt;urrent&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (command "_.layer" "_off" "*" "_no" "")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (princ)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, a plain old&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; LAYERP&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;command will restore the previous conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[That assumes you haven't upped the setting of the EXPERT System Variable to 1 or more.&amp;nbsp; If you have, and that is your standard setting, omit the&lt;FONT face="courier new,courier" color="#000000"&gt;&lt;STRONG&gt; "_no"&lt;/STRONG&gt;&lt;/FONT&gt;.]&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 11:43:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11194592#M45121</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-05-26T11:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11196121#M45122</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The LAYISO command was new to me.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, I could not get the desired result with isolation.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you for your valuable functions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Especially, the tblnext command is very useful!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sorry, I didn&lt;/SPAN&gt;&lt;SPAN&gt;'t understand all of it, it was too long!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I didn'&lt;/SPAN&gt;&lt;SPAN&gt;t realize that the original layer command alone can be used for this purpose!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you all very much!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 May 2022 22:09:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11196121#M45122</guid>
      <dc:creator>saitoib</dc:creator>
      <dc:date>2022-05-26T22:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Hide all but the current layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11196240#M45123</link>
      <description>&lt;P&gt;Regards&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5108811"&gt;@saitoib&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't need Lisp to do what you require, use ISOLATE...,Then you can restore it with UNISOLATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="calderg1000_0-1653606939943.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1072589iB3F6881ACBF9AEC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="calderg1000_0-1653606939943.png" alt="calderg1000_0-1653606939943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 23:20:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/hide-all-but-the-current-layer/m-p/11196240#M45123</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2022-05-26T23:20:28Z</dc:date>
    </item>
  </channel>
</rss>

