<?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 Re: Layer visibility for particular layers starts with &amp;quot;Elect&amp;quot; in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8420106#M96293</link>
    <description>&lt;P&gt;Well, as I see it, the only advantage that this routine offers over the regular LayWalk command is the ability to ZOOM.&lt;/P&gt;
&lt;P&gt;IMHO that's unnecessarily&amp;nbsp;limited. I'll want to do more than that - the ability to&amp;nbsp;do something with objects... select them, check the types, check the length, move them to a different layer, remove them for good... or whatever.&lt;/P&gt;
&lt;P&gt;So my solution would be different. My routine does not stay active during the&amp;nbsp;whole process. You will need to recall the&amp;nbsp;routine to move to the next layer. But that is quite easy because the command is the last one, so just hit &amp;lt;enter&amp;gt;. When you need to run&amp;nbsp;another command during the process - you're good to go... after you're done, recall the routine and you'll move to the&amp;nbsp;next layer.&lt;/P&gt;
&lt;P&gt;Well, to be honest, I wrote it according to my own idea of preferable workflow, for my own usage. But if you find that this makes sense to you as well, your welcome to use it. Feel free to rename it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

; Funtions of LayerWalkOnebyOne
; LWOneByOne or NL - main funtion. Set the mask if any, command will show the first layer.
;                                  For next layer run the command again.
;                                  The run next to the last layer will reset layer state.
; LW_RestoreLayerState - restore layer state from "$NL-TMP" which will be erase. But you can still continue in LWOneBeOne
; LW_NewWalkRestoreLayerState - restore layer state from "$NL-TMP" which will be erase. You will start over.

; BeekeeCZ 2018-11

;-----
(defun c:&lt;FONT color="#FF0000"&gt;LW_RestoreLayerState&lt;/FONT&gt; ()
  (and (layerstate-restore "$NL-TMP" nil)
       (layerstate-delete "$NL-TMP"))
  (princ))

;-----
(defun c:&lt;FONT color="#FF0000"&gt;LW_NewWalk&lt;/FONT&gt; ()
  (and (layerstate-restore "$NL-TMP" nil)
       (layerstate-delete "$NL-TMP"))
  (setq *lw1-lst* nil)
  (princ "\nType to run 'LWOnebyOne'")
  (princ))

;-----
(defun c:&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NL&lt;/FONT&gt;&lt;/STRONG&gt; nil (c:LWOnebyOne))
(defun c:&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;LWOnebyOne&lt;/FONT&gt;&lt;/STRONG&gt; (/ *error* cmd :GetLayers doc flt)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if cmd (setvar 'cmdecho cmd))
    (princ))
  
  (defun :GetLayers (doc flt / layname lst)
    (vlax-for layer (vla-get-layers doc)
      (if (and (not (wcmatch (setq layname (vla-get-name layer)) "*|*"))
	       (wcmatch (strcase layname) (strcase (strcat "*" flt "*")))
	       )
	(setq lst (cons layname lst))))
    (vl-sort lst '&amp;lt;))
  
  
  (setq cmd (getvar 'cmdecho))
  (setvar 'cmdecho 0)
  
  (if (cond (*lw1-lst*)
	    
	    ((layerstate-restore "$NL-TMP" nil)
	     (layerstate-delete "$NL-TMP")
	     *lw1-lst*)
	    
	    ((setq flt (getstring T "\nFilter layer by mask &amp;lt;all&amp;gt;: ")
		   doc (vla-get-activedocument (vlax-get-acad-object))
		   *lw1-lst* (:GetLayers doc flt))
	     (vl-cmdf "_.-LAYER" "_stAte" "_Save" "$NL-TMP" "" "" "")
	     (not (graphscr))))
    (progn
      (command "_.-LAYER" "_Thaw" (car *lw1-lst*) "_Set" (car *lw1-lst*) "_Freeze" "*" "")
      (princ (strcat "\rCurrent layer: " (car *lw1-lst*) "   &amp;gt;&amp;gt; next " (itoa (length (setq *lw1-lst* (cdr *lw1-lst*)))) " layers "))))
  
  (*error* "end")
  )&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Nov 2018 08:49:56 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2018-11-23T08:49:56Z</dc:date>
    <item>
      <title>Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418070#M96275</link>
      <description>&lt;P&gt;Dear Helpers,&lt;/P&gt;
&lt;P&gt;Could you please help on below code to update to work on only layers starts with &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"Elect"&lt;/FONT&gt;&lt;/STRONG&gt;. The below code works on all layers in autocad to turn on each layer separately. But it should create a selection set for Layer names which start with &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;"Elect"&amp;nbsp;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;Only.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;(defun c:NL()
	(if (= lay nil) (setq num 0))
	(setq entlay (tblnext "layer" num))
	(setq lay (cdr (assoc 2 entlay)))
	(command "layer" "s" lay "off" "*" "" "")
	(setq num nil))
&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 07:04:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418070#M96275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T07:04:59Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418137#M96276</link>
      <description>&lt;P&gt;What you tried, all elec* layers turn off?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;; all "ELEC*" Layer off
(defun c:NL()
  (command "_.layer" "_off" "ELEC*" "" "")
 (princ)
)
&lt;BR /&gt;Check [F1] help &lt;BR /&gt;&lt;A href="http://help.autodesk.com/view/ACD/2019/ENU/?guid=GUID-2C75A883-10CA-4B6C-96AC-BCD7A7794614" target="_blank"&gt;-LAYER (command)&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.autodesk.com/view/ACD/2019/ENU/?guid=GUID-EC257AF7-72D4-4B38-99B6-9B09952A53AD" target="_blank"&gt;- Wildcards&lt;/A&gt;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 07:55:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418137#M96276</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2018-11-22T07:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418139#M96277</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:NL (/)
  (vl-load-com)
  (command "cmdecho" 0)
  (setq layerslist nil)
  (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
    (if (wcmatch (setq layername (vla-get-name layer)) "Elect*")
      (setq layerslist (cons layername layerslist))
    )
  )
  (setq layerslist (acad_strlsort layerslist))
  (command "_-layer" "_s" (nth 0 layerslist) "off" "*" "" "")
  (repeat (- (setq N (length layerslist)) 1)
	(command "_-layer" "on" (nth (setq N (- N 1)) layerslist) "")
  )
(command "cmdecho" 1)
(princ)
)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;all "Elect*" layers turn&amp;nbsp;on.....&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 08:00:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418139#M96277</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-22T08:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418169#M96278</link>
      <description>&lt;P&gt;Thank you for attending my problem, Sir.&lt;/P&gt;
&lt;P&gt;This lisp&amp;nbsp;turning off all layers, excpet name starts with "Elect".&lt;/P&gt;
&lt;P&gt;But&amp;nbsp;my requirement should toggle the visibility of all "Elect" named layers.&lt;/P&gt;
&lt;P&gt;For suppose I have layers like below&lt;/P&gt;
&lt;P&gt;Elect 1&lt;BR /&gt;Elect 2&lt;BR /&gt;Elect 3&lt;BR /&gt;Elect 4&lt;BR /&gt;Elect 5&lt;BR /&gt;Elect 6&lt;BR /&gt;Elect 7&lt;BR /&gt;Elect 8&lt;/P&gt;
&lt;P&gt;Then The lisp should turnoff all cad layers. Then it should turn on First only "Elect1" layer, then after pressing enter again it should turn on only "Elect2", then&amp;nbsp; after pressing enter button "Elect3" ...........Like&lt;/P&gt;
&lt;P&gt;I think you got my point sir.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 08:11:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418169#M96278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T08:11:50Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418172#M96279</link>
      <description>&lt;P&gt;Thank you Sir,&lt;/P&gt;
&lt;P&gt;Reached to some level.&lt;/P&gt;
&lt;P&gt;But this lisp should go through only "Elect" named layers only. It's toggling only Elect named layers as per my requirements. Suppose I have 1000 layers and only 20 layers with Elect named. Then I should not press enter 1000 times to get the visibility of elect named layers. Suppose I have layers like below&lt;/P&gt;
&lt;P&gt;Elect 1&lt;BR /&gt;Elect 2&lt;BR /&gt;Elect 3&lt;BR /&gt;Elect 4&lt;BR /&gt;Elect 5&lt;BR /&gt;Elect 6&lt;BR /&gt;Elect 7&lt;BR /&gt;Elect 8&lt;/P&gt;
&lt;P&gt;The lisp command should stars with Elect 1 and finish with Elect 8 layer with 8 times of enter button pressing. Then the lisp should starts at Elect 1 only.&lt;/P&gt;
&lt;P&gt;In your case the lisp rotating through all layers, Sir.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 08:21:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418172#M96279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T08:21:14Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418221#M96280</link>
      <description>&lt;P&gt;Try this.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:NL (/)
  (vl-load-com)
  (command "cmdecho" 0)
  (setq layerslist nil)
  (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
    (if (wcmatch (setq layername (vla-get-name layer)) "Elect*")
      (setq layerslist (cons layername layerslist))
    )
  )
  (setq layerslist (acad_strlsort layerslist))
  (command "_-layer" "_s" 0 "off" "*" "" "")
  (setq L -1)
  (repeat (setq N (length layerslist))
    (initget 1 "Y N")
    (setq OPT (getkword (strcat "\nWant to Turn on Layer &amp;lt;" (nth (setq L (+ L 1)) layerslist) "&amp;gt; (Y/N): ")))
	(cond ((= OPT "Y")
		(command "_-layer" "on" (nth L layerslist) "")
	      )
	)
  )
(command "cmdecho" 1)
(princ)
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 08:44:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418221#M96280</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-22T08:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418298#M96281</link>
      <description>&lt;P&gt;Do you need to do this with LISP?&amp;nbsp; Seems like LAYWALK command may suite your needs?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 09:24:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418298#M96281</guid>
      <dc:creator>Shneuph</dc:creator>
      <dc:date>2018-11-22T09:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418460#M96282</link>
      <description>&lt;P&gt;Thank you Very much,&lt;/P&gt;
&lt;P&gt;I know this command, but for 1000 no.of layers, it's very difficult to check in that command.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 10:26:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418460#M96282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T10:26:11Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418469#M96283</link>
      <description>&lt;P&gt;Thank you very much for your efforts.&lt;/P&gt;
&lt;P&gt;The code is working like, it showing one by one Elect named layers.&lt;/P&gt;
&lt;P&gt;Nearly reached my requirement. But my exact requirement is, at a time one Elect named layer only displayed and remaining layers should be turned off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 10:32:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418469#M96283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T10:32:03Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418492#M96284</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try This.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:NL (/)
  (vl-load-com)
  (command "cmdecho" 0)
  (setq layerslist nil)
  (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
    (if (wcmatch (setq layername (vla-get-name layer)) "Elect*")
      (setq layerslist (cons layername layerslist))
    )
  )
  (setq layerslist (acad_strlsort layerslist))
  (command "_-layer" "_s" 0 "off" "*" "" "")
  (setq L -1)
  (repeat (setq N (length layerslist))
    (initget 1 "Y N")
    (setq OPT (getkword (strcat "\nWant to Turn on Layer &amp;lt;" (nth (setq L (+ L 1)) layerslist) "&amp;gt; (Y/N): ")))
	(cond ((= OPT "Y")
		(command "_-layer" "_s" (nth L layerslist) "off" "*" "" "")
	      )
	)
  )
(command "cmdecho" 1)
(princ)
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 10:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418492#M96284</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-22T10:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418540#M96285</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you Very much,&lt;/P&gt;
&lt;P&gt;I know this command, but for 1000 no.of layers, it's very difficult to check in that command.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You know that the&amp;nbsp;LAYWALK has a filter option on the top of the list?&lt;/P&gt;
&lt;P&gt;Just type Elect*&amp;lt;enter&amp;gt; and you'll see only those.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW what are you going&amp;nbsp;to do with those isolated layers next?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 11:12:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418540#M96285</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-11-22T11:12:49Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418542#M96286</link>
      <description>&lt;P&gt;Command: NL&lt;BR /&gt;cmdecho&lt;BR /&gt;Enter new value for CMDECHO &amp;lt;1&amp;gt;: 0&lt;BR /&gt;Usage: (acad_strlsort &amp;lt;list of strings&amp;gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting above error in autocad while giving command after lisp loading. Can you please help me?.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 11:10:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418542#M96286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T11:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418571#M96287</link>
      <description>&lt;P&gt;I have lot of 11kV Voltage networks areas wise in one state of India. So I have to do quality check. So it is most usable to check area wise. The same area should not be repeated at 2 diifferent locations. Thank you Very much Sir.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 11:25:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418571#M96287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T11:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418579#M96288</link>
      <description>&lt;P&gt;And also Zoom command will not work while LAYWALK is working.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 11:28:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418579#M96288</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T11:28:43Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418589#M96289</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can not say why you are getting this error message?....................&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not getting any such&amp;nbsp;&lt;SPAN&gt;error message?....................&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 348px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/572524i72D0487468C912F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try in other system&amp;nbsp;or&amp;nbsp;give a sample drawing..............&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 11:34:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418589#M96289</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-22T11:34:23Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418633#M96290</link>
      <description>&lt;P&gt;In new drawing it's working fentastic.&lt;/P&gt;
&lt;P&gt;But every time it's asking for "Y" Option to go to next layer as below&lt;/P&gt;
&lt;P&gt;"Want to Turn on Layer &amp;lt;Elect 7&amp;gt; (Y/N): Y"&lt;/P&gt;
&lt;P&gt;Could you please make it without entering any keyword for each time. and also the in place of "Elect", can I feed any user input?.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for your hard efforts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 12:00:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418633#M96290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T12:00:13Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418722#M96291</link>
      <description>&lt;P&gt;Try this.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:NL (/)
  (vl-load-com)
  (command "cmdecho" 0)
  (setq layerslist nil)
  (setq LAN (getstring "\nEnter Layer Name (Few Matching Word from Prefix it's Case sensitive): "))
  (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
    (if (wcmatch (setq layername (vla-get-name layer)) (strcat LAN "*"))
      (setq layerslist (cons layername layerslist))
    )
  )
  (setq layerslist (acad_strlsort layerslist))
  (command "_-layer" "_s" 0 "off" "*" "" "")
  (setq L -1)
  (repeat (setq N (length layerslist))
    (initget "Y N")
    (setq OPT (getkword (strcat "\nWant to Turn on Layer &amp;lt;" (nth (setq L (+ L 1)) layerslist) "&amp;gt; [Y/N]&amp;lt;Y&amp;gt;: ")))
	(if (or (= OPT "Y") (= OPT nil))
		(command "_-layer" "_s" (nth L layerslist) "off" "*" "" "")
	)
  )
(command "cmdecho" 1)
(princ)
)&lt;/PRE&gt;
&lt;P&gt;If you hit enter it will consider that as "Yes" otherwise press "N" and hit enter........&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 12:55:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418722#M96291</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-22T12:55:39Z</dc:date>
    </item>
    <item>
      <title>Betreff: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418760#M96292</link>
      <description>&lt;P&gt;Perfectly Suited to my requirement. Thank you So much.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 13:13:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8418760#M96292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T13:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Layer visibility for particular layers starts with "Elect"</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8420106#M96293</link>
      <description>&lt;P&gt;Well, as I see it, the only advantage that this routine offers over the regular LayWalk command is the ability to ZOOM.&lt;/P&gt;
&lt;P&gt;IMHO that's unnecessarily&amp;nbsp;limited. I'll want to do more than that - the ability to&amp;nbsp;do something with objects... select them, check the types, check the length, move them to a different layer, remove them for good... or whatever.&lt;/P&gt;
&lt;P&gt;So my solution would be different. My routine does not stay active during the&amp;nbsp;whole process. You will need to recall the&amp;nbsp;routine to move to the next layer. But that is quite easy because the command is the last one, so just hit &amp;lt;enter&amp;gt;. When you need to run&amp;nbsp;another command during the process - you're good to go... after you're done, recall the routine and you'll move to the&amp;nbsp;next layer.&lt;/P&gt;
&lt;P&gt;Well, to be honest, I wrote it according to my own idea of preferable workflow, for my own usage. But if you find that this makes sense to you as well, your welcome to use it. Feel free to rename it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

; Funtions of LayerWalkOnebyOne
; LWOneByOne or NL - main funtion. Set the mask if any, command will show the first layer.
;                                  For next layer run the command again.
;                                  The run next to the last layer will reset layer state.
; LW_RestoreLayerState - restore layer state from "$NL-TMP" which will be erase. But you can still continue in LWOneBeOne
; LW_NewWalkRestoreLayerState - restore layer state from "$NL-TMP" which will be erase. You will start over.

; BeekeeCZ 2018-11

;-----
(defun c:&lt;FONT color="#FF0000"&gt;LW_RestoreLayerState&lt;/FONT&gt; ()
  (and (layerstate-restore "$NL-TMP" nil)
       (layerstate-delete "$NL-TMP"))
  (princ))

;-----
(defun c:&lt;FONT color="#FF0000"&gt;LW_NewWalk&lt;/FONT&gt; ()
  (and (layerstate-restore "$NL-TMP" nil)
       (layerstate-delete "$NL-TMP"))
  (setq *lw1-lst* nil)
  (princ "\nType to run 'LWOnebyOne'")
  (princ))

;-----
(defun c:&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NL&lt;/FONT&gt;&lt;/STRONG&gt; nil (c:LWOnebyOne))
(defun c:&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;LWOnebyOne&lt;/FONT&gt;&lt;/STRONG&gt; (/ *error* cmd :GetLayers doc flt)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if cmd (setvar 'cmdecho cmd))
    (princ))
  
  (defun :GetLayers (doc flt / layname lst)
    (vlax-for layer (vla-get-layers doc)
      (if (and (not (wcmatch (setq layname (vla-get-name layer)) "*|*"))
	       (wcmatch (strcase layname) (strcase (strcat "*" flt "*")))
	       )
	(setq lst (cons layname lst))))
    (vl-sort lst '&amp;lt;))
  
  
  (setq cmd (getvar 'cmdecho))
  (setvar 'cmdecho 0)
  
  (if (cond (*lw1-lst*)
	    
	    ((layerstate-restore "$NL-TMP" nil)
	     (layerstate-delete "$NL-TMP")
	     *lw1-lst*)
	    
	    ((setq flt (getstring T "\nFilter layer by mask &amp;lt;all&amp;gt;: ")
		   doc (vla-get-activedocument (vlax-get-acad-object))
		   *lw1-lst* (:GetLayers doc flt))
	     (vl-cmdf "_.-LAYER" "_stAte" "_Save" "$NL-TMP" "" "" "")
	     (not (graphscr))))
    (progn
      (command "_.-LAYER" "_Thaw" (car *lw1-lst*) "_Set" (car *lw1-lst*) "_Freeze" "*" "")
      (princ (strcat "\rCurrent layer: " (car *lw1-lst*) "   &amp;gt;&amp;gt; next " (itoa (length (setq *lw1-lst* (cdr *lw1-lst*)))) " layers "))))
  
  (*error* "end")
  )&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Nov 2018 08:49:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-visibility-for-particular-layers-starts-with-quot-elect/m-p/8420106#M96293</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-11-23T08:49:56Z</dc:date>
    </item>
  </channel>
</rss>

