<?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 Select Objects based on Layer Name in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017596#M84322</link>
    <description>&lt;P&gt;Hello, I have a great idea for a lisp. I hope someone can help me so that many others can use it as well. I am very new to lisp routines, so any help would be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to start a lisp that uses the ssget "_x" function to choose layers so that the properties can be altered. In this example we can use different text layers and change the height of the all text using the properties pallet. The goal is to have the name of the layer(any name that the user presets) on the lisp and have the object selected so they can use the properties palette to modify the text height. The same can be done with object, but in this (object) case it will be by x y z scaling not text height.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started the lisp and it looks like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:SelectLay ()&lt;/P&gt;&lt;P&gt;(setq sel1 (ssget "_X" '(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text"))&lt;/P&gt;&lt;P&gt;(princ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started but have little experience on how to finish (or continue) the lisp so that the objects are picked and highlighted. That way the user can modify the object in the properties palette.&lt;/P&gt;&lt;P&gt;Can anyone help identify how I can achieve this? or can someone guide me to useful links so I can further my understanding for what I may be doing wrong? Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the lisp routine gives me no results, I feel like maybe this is not a very good start but any help would be appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 20:52:20 GMT</pubDate>
    <dc:creator>jeguizaASRZM</dc:creator>
    <dc:date>2019-09-10T20:52:20Z</dc:date>
    <item>
      <title>Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017596#M84322</link>
      <description>&lt;P&gt;Hello, I have a great idea for a lisp. I hope someone can help me so that many others can use it as well. I am very new to lisp routines, so any help would be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to start a lisp that uses the ssget "_x" function to choose layers so that the properties can be altered. In this example we can use different text layers and change the height of the all text using the properties pallet. The goal is to have the name of the layer(any name that the user presets) on the lisp and have the object selected so they can use the properties palette to modify the text height. The same can be done with object, but in this (object) case it will be by x y z scaling not text height.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started the lisp and it looks like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:SelectLay ()&lt;/P&gt;&lt;P&gt;(setq sel1 (ssget "_X" '(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text"))&lt;/P&gt;&lt;P&gt;(princ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started but have little experience on how to finish (or continue) the lisp so that the objects are picked and highlighted. That way the user can modify the object in the properties palette.&lt;/P&gt;&lt;P&gt;Can anyone help identify how I can achieve this? or can someone guide me to useful links so I can further my understanding for what I may be doing wrong? Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the lisp routine gives me no results, I feel like maybe this is not a very good start but any help would be appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 20:52:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017596#M84322</guid>
      <dc:creator>jeguizaASRZM</dc:creator>
      <dc:date>2019-09-10T20:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017620#M84323</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7731369"&gt;@jeguizaASRZM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hello, I have a great idea for a lisp. I hope someone can help me so that many others can use it as well. I am very new to lisp routines, so any help would be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to start a lisp that uses the &lt;FONT color="#0000FF"&gt;ssget "_x" function to choose layers so that the properties can be altered&lt;/FONT&gt;. In this example we can use different text layers and change the &lt;FONT color="#0000FF"&gt;height of the all text using the properties pallet&lt;/FONT&gt;. &lt;FONT color="#0000FF"&gt;The goal is to have the name of the layer(any name that the user presets) on the lisp and have the object selected so they can use the properties palette to modify the text height&lt;/FONT&gt;. The same can be done with object, but in this (object) case it will be by x y z scaling not text height.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started the lisp and it looks like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:SelectLay ()&lt;/P&gt;&lt;P&gt;(setq sel1 (ssget "_X" '(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text"))&lt;/P&gt;&lt;P&gt;(princ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started but have little experience on how to finish (or continue) the lisp so that the objects are picked and highlighted. That way the user can modify the object in the properties palette.&lt;/P&gt;&lt;P&gt;Can anyone help identify how I can achieve this? or can someone guide me to useful links so I can further my understanding for what I may be doing wrong? Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the lisp routine gives me no results, I feel like maybe this is not a very good start but any help would be appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your syntax should be like this.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To select all objects in Layers "Layer1Text, Layer2Text, Layer3Text".......&lt;/P&gt;&lt;PRE&gt;(defun C:SelectLay ( / sel1)&lt;BR /&gt;(setq sel1 (ssget "_X" '((-4 . "&amp;lt;or")(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text*")(-4 . "or&amp;gt;"))))&lt;BR /&gt;(sssetfirst nil sel1)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To select only "TEXT,MTEXT,DTEXT" in Layers "Layer1Text, Layer2Text, Layer3Text".......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:SelectLay ( / sel1)
;(setq sel1 (ssget "_X" '((-4 . "&amp;lt;or")(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text*")(-4 . "or&amp;gt;"))))
(setq sel1 (ssget "_X" '((0 . "*TEXT")(-4 . "&amp;lt;or")(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text*")(-4 . "or&amp;gt;"))))
(sssetfirst nil sel1)
(princ)
)&lt;/PRE&gt;&lt;P&gt;To learn more about "SSGET" go through&amp;nbsp;&lt;A href="http://www.lee-mac.com/ssget.html" target="_blank" rel="noopener"&gt;&amp;gt;&amp;gt;This&amp;lt;&amp;lt;&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/files/GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3-htm.html" target="_blank" rel="noopener"&gt;&amp;gt;&amp;gt;This&amp;lt;&amp;lt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 21:41:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017620#M84323</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2019-09-10T21:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017917#M84324</link>
      <description>&lt;P&gt;It can be simpler than that.&amp;nbsp; You can string multiple text-string values together with comma separators, in (wcmatch) fashion:&lt;/P&gt;
&lt;PRE&gt;(setq sel1 &lt;FONT color="#000000"&gt;(&lt;/FONT&gt;ssget "_X" '&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;(8 . "&lt;FONT color="#0000ff"&gt;Layer1Text,Layer2Text,Layer3Text&lt;/FONT&gt;") &lt;FONT color="#0000ff"&gt;(0 . "*TEXT")&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;))
&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;[The &lt;FONT color="#ff0000"&gt;red parentheses&lt;/FONT&gt; enclose the (ssget) &lt;EM&gt;filter list&lt;/EM&gt;, whose entries still need to be inside a list even if it contains only one entry.]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you never have anything other than Text-variety objects on those Layers, then you don't need the &lt;FONT style="box-sizing: border-box; color: #0000ff; font-family: &amp;amp;quot; artifakt&amp;amp;quot;,tahoma,helvetica,arial,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;" color="#0000ff"&gt;(0 . "*TEXT")&lt;/FONT&gt; part, but presumably they may also contain things like Leaders that you may not want included, so putting that in will limit what kinds of things it finds.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 02:16:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017917#M84324</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-11T02:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019350#M84325</link>
      <description>&lt;P&gt;Awesome!! The routine worked great!!&lt;/P&gt;&lt;P&gt;Thank You for the help!! Can you explain about the conditions in the first routine&lt;/P&gt;&lt;PRE&gt;(defun C:SelectLay ( / sel1)&lt;BR /&gt;(setq sel1 (ssget "_X" '((-4 . "&amp;lt;or")(8 . "Layer1Text")(8 . "Layer2Text")(8 . "Layer3Text*")(-4 . "or&amp;gt;"))))&lt;BR /&gt;(sssetfirst nil sel1)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifically&amp;nbsp; The (-4 . "&amp;lt;or") portion, i know that this is a group code but what does this do?&lt;/P&gt;&lt;P&gt;Thank You for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 15:14:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019350#M84325</guid>
      <dc:creator>jeguizaASRZM</dc:creator>
      <dc:date>2019-09-11T15:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019373#M84326</link>
      <description>&lt;P&gt;I have a question, I modified the code to read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq sel1 (ssget "_X" '((8 . "Layer1,Layer2,Layer3"))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it prompts a "selection set". This gives me code "22ce" . How can I recall this "selection set" be used?&lt;/P&gt;&lt;P&gt;Thank You for the Knowledge!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 15:19:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019373#M84326</guid>
      <dc:creator>jeguizaASRZM</dc:creator>
      <dc:date>2019-09-11T15:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019533#M84327</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7731369"&gt;@jeguizaASRZM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I have a question, I modified the code to read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;(setq sel1 (ssget "_X" '((8 . "Layer1,Layer2,Layer3"))))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it prompts a "selection set". This gives me code "22ce" . How can I recall this "selection set" be used?&lt;/P&gt;&lt;P&gt;Thank You for the Knowledge!&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your message should be like "&lt;FONT color="#0000FF"&gt;&amp;lt;selection set: 22ce&amp;gt;&lt;/FONT&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it means Entity name of all the objects in the layers &lt;FONT color="#FF0000"&gt;"Layer1,Layer2,Layer3"&amp;nbsp;&lt;/FONT&gt;are in the taken in the selection set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you have to go through the each Entity of Selection set....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example.......like ..... in short.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:SelectLay ( / sel1 n)
(setq sel1 (ssget "_X" '((0 . "*TEXT")(8 . "Layer1Text,Layer2Text,Layer3Text"))))
(repeat (setq n (sslength sel1));;;count number of entity and go through the each entity
	(print (cdr(assoc 1 (entget (ssname sel1 (setq n (- n 1)))))));;;print text value
)
(princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 16:22:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019533#M84327</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2019-09-11T16:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019597#M84328</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7731369"&gt;@jeguizaASRZM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... I modified the code to read:&lt;/P&gt;
&lt;P&gt;(setq sel1 (ssget "_X" '((8 . "Layer1,Layer2,Layer3"))))&lt;/P&gt;
... it prompts a "selection set". This gives me code "22ce" . How can I recall this "selection set" be used? ....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't use the "22ce" directly, but rather the &lt;STRONG&gt;&lt;FONT color="#000000"&gt;sel1&lt;/FONT&gt;&lt;/STRONG&gt; variable that you saved the selection into.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on what you want to do with the objects found, you may sometimes need to step through the selection set using &lt;FONT color="#000000"&gt;(ssname)&lt;/FONT&gt; to pull individual entity names out of the set, as in &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5869979"&gt;@dbhunia&lt;/a&gt;'s example.&amp;nbsp; Or, to do things to everything collectively via the Properties palette as in your original description, his &lt;FONT color="#000000"&gt;(sssetfirst nil &lt;STRONG&gt;sel1&lt;/STRONG&gt;)&lt;/FONT&gt; would leave them all selected/highlighted/gripped for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For certain operations, you can just feed the variable name in where any command asks for object selection, e.g. if you want them all given a color override of yellow:&lt;/P&gt;
&lt;PRE&gt;(command "_.chprop" &lt;STRONG&gt;&lt;FONT color="#000000"&gt;sel1&lt;/FONT&gt;&lt;/STRONG&gt; "" "_color" 2 "")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 16:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019597#M84328</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-11T16:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019685#M84329</link>
      <description>&lt;P&gt;Awesome!! Thank You for the information! I was able to use the lisp in both instances, Great explanation. I hope Someone will also benefit from this Routine. Thank You for the Help&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;Thank You for the example of using the selection set for future operations as well as the routine!&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5869979"&gt;@dbhunia&lt;/a&gt;&amp;nbsp;Thank You for correcting the routine and setting improved variables for selection to be able to modify the objects!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time, generosity, and explanations!&lt;/P&gt;&lt;P&gt;JE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 17:24:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9019685#M84329</guid>
      <dc:creator>jeguizaASRZM</dc:creator>
      <dc:date>2019-09-11T17:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9020122#M84330</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7731369"&gt;@jeguizaASRZM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;Thank You for the example of using the selection set for future operations as well as the routine!&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just so you aren't misled....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The parentheses at the end of the first line of code in the code windows in Messages 2, 4 &amp;amp; 6 all list the sel1 variable name after the forward-slash, which means it is a "localized variable," which means it "exists" only within and for the purposes of the routine, and will not "survive" beyond the conclusion of the routine.&amp;nbsp; If you want to be able to use the same selection set for "future operations" after the routine is done, &lt;EM&gt;remove&lt;/EM&gt; the variable name from that localized-variables list, and it will still exist afterwards.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 20:42:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9020122#M84330</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-11T20:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9020146#M84331</link>
      <description>&lt;P&gt;So for future operations is selection set a stored variable? If so, Where can I find this selection sets? and how can AutoCAD bring back that selection set for modification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Now I do understand that the defined variable "sel1" is excising only within the routine, Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You for your time!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 20:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9020146#M84331</guid>
      <dc:creator>jeguizaASRZM</dc:creator>
      <dc:date>2019-09-11T20:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9020176#M84332</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7731369"&gt;@jeguizaASRZM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So for future operations is selection set a stored variable? If so, Where can I find this selection sets? and how can AutoCAD bring back that selection set for modification. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any saved variable that was not localized is still around until you close the drawing [or set it to nil, e.g. &lt;FONT color="#000000"&gt;(setq sel1 nil)&lt;/FONT&gt;].&amp;nbsp; You can use it directly by its name within AutoLisp expressions, such as the (command) function at the end of Message 7.&amp;nbsp; Or &lt;EM&gt;outside&lt;/EM&gt;&amp;nbsp; AutoLisp, you can use it by typing in its name &lt;EM&gt;preceded by an &lt;FONT color="#FF0000"&gt;exclamation point&lt;/FONT&gt;&lt;/EM&gt;.&amp;nbsp; For example, if you don't localize the sel1 variable, and after your routine you then want to, let's say, Move the same set of things, you can start a MOVE command, and when it asks for object selection, type in:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; !&lt;/FONT&gt;&lt;FONT color="#000000"&gt;sel1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;and it will add all of those things to the selection for the command.&amp;nbsp; [You will still be able to select more things, or use other object-selection options such as to remove some, etc., so if you want only those, you'll still need to follow that with yet another Enter to complete the selection.]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For variables containing things other than selection sets [for example, text strings or numbers], you can have a report of what they contain by just typing the same exclamation-point-plus-variable name with no command active.&amp;nbsp; If you do that for the example sel1 variable name, you'll see that same:&lt;BR /&gt;&amp;nbsp; &lt;FONT color="#000000"&gt;&amp;lt;Selection set: 22cs&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;reported, which doesn't tell you much about it, but at least identifies the variable as containing a selection set.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 21:14:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9020176#M84332</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-09-11T21:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select Objects based on Layer Name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9021909#M84333</link>
      <description>&lt;P&gt;I see! By using " !(followed by the selection set variable) " this will bring back the selection set so further operations can be used with the stored variables!&lt;/P&gt;&lt;P&gt;Thank You so much for the insight!&lt;/P&gt;&lt;P&gt;This was great help for me!&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Hope someone will find this and make use for it as well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 16:41:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9021909#M84333</guid>
      <dc:creator>jeguizaASRZM</dc:creator>
      <dc:date>2019-09-12T16:41:22Z</dc:date>
    </item>
  </channel>
</rss>

