<?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: selected objects to new layer in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6979543#M121895</link>
    <description>&lt;P&gt;Quick (no error or undo)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:C2NL ( / ss layer)
  (and
    (princ "\nSelect objects to change to new layer: ")
    (setq ss (ssget))
    (setq layer (getstring "\nNew layer name: "))
    (or
      (snvalid layer)
      (prompt "\nInvalid layer name.")
    )
    (vl-cmdf "_.-layer" "_M" layer "")
    (vl-cmdf "_.chprop" ss "" "_La" layer "")
  )
  (princ)
)&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Mar 2017 19:10:46 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2017-03-28T19:10:46Z</dc:date>
    <item>
      <title>selected objects to new layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6974706#M121894</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyone could help me to make a lisp to change selected objects to new layer? &amp;nbsp;(as shown in dwg file)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 06:01:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6974706#M121894</guid>
      <dc:creator>jyan2000</dc:creator>
      <dc:date>2017-03-27T06:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: selected objects to new layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6979543#M121895</link>
      <description>&lt;P&gt;Quick (no error or undo)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:C2NL ( / ss layer)
  (and
    (princ "\nSelect objects to change to new layer: ")
    (setq ss (ssget))
    (setq layer (getstring "\nNew layer name: "))
    (or
      (snvalid layer)
      (prompt "\nInvalid layer name.")
    )
    (vl-cmdf "_.-layer" "_M" layer "")
    (vl-cmdf "_.chprop" ss "" "_La" layer "")
  )
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:10:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6979543#M121895</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-03-28T19:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: selected objects to new layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6979601#M121896</link>
      <description>&lt;P&gt;About the "including blocks" part....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your sample drawing contains two Blocks [with wacky PasteBlock names] that are the same except for the Layer(s) of the objects nested in them.&amp;nbsp; The one with multiple non-0 Layers represented in its parts is &lt;EM&gt;inserted&lt;/EM&gt; on Layer 0, which is&amp;nbsp;all you would get from &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;'s suggestion -- it wouldn't change the pieces&lt;EM&gt; inside&lt;/EM&gt; the Block definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously for sample purposes in the &lt;EM&gt;same&lt;/EM&gt; drawing you need those to be &lt;EM&gt;different&lt;/EM&gt; Block names.&amp;nbsp; But is it your intent that a Block like that, among the selected objects,&amp;nbsp;should be &lt;EM&gt;redefined,&lt;/EM&gt; so that all its pieces, as well as its insertion,&amp;nbsp;are on Layer 0, thus affecting &lt;EM&gt;all&lt;/EM&gt; insertions of that Block in the drawing?&amp;nbsp; Or should it be made into a new Block with a &lt;EM&gt;different&lt;/EM&gt; name as in your sample, so that other insertions of it that were &lt;EM&gt;not&lt;/EM&gt; selected can remain as they are, with the original definition and the original Layers of the nested objects?&amp;nbsp;&amp;nbsp;Would it be acceptable to just &lt;EM&gt;Explode&lt;/EM&gt; all selected Blocks and put all the &lt;EM&gt;resulting pieces&lt;/EM&gt; on Layer 0, rather than have them in Blocks in the end result?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:30:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6979601#M121896</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-03-28T19:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: selected objects to new layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6980442#M121897</link>
      <description>&lt;P&gt;Hello Kent Cooper and John Uhden,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and Thanks to you John Uhden for your quick reply. John Uhden's code works well.&lt;/P&gt;&lt;P&gt;- Blocks move to new layer but&amp;nbsp;everything inside the blocks also must move to under new layer name or Layer 0.&lt;/P&gt;&lt;P&gt;- It doesnt has to be new block name.&lt;/P&gt;&lt;P&gt;- Insertion point can remain as it is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;- blocks can explode and put in one layer. &lt;EM&gt;(that was the intention else John Uhden's code good enough)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why i need this lisp is, its really hard to control certain objects in a huge drawings. I just want to put some objects to new Named layer/s. So i can easily Freeze / off others and work on those new layer/s.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regars&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 06:19:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selected-objects-to-new-layer/m-p/6980442#M121897</guid>
      <dc:creator>jyan2000</dc:creator>
      <dc:date>2017-03-29T06:19:28Z</dc:date>
    </item>
  </channel>
</rss>

