<?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: Change block objects to layer 0 and keep objects colors and other properties in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986784#M65673</link>
    <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some info you should know about AutoCAD block reference (insert). say you have some blocks reference in "layer1", if you freeze it, all blocks goes to 'sleep' &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;. so to answer your question, change all those blocks to some "sleep" layer,&amp;nbsp; and you can do it quickly using QSelect or SSX commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2021 09:27:19 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2021-01-08T09:27:19Z</dc:date>
    <item>
      <title>Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986023#M65670</link>
      <description>&lt;P&gt;Hello. I was looking for a lisp that could change any objcects inside a block to layer 0 but i don't want to change its lintypes, linewights and colors. I only need the inside layers to be changed so i can freeze the layer if a want to, but when turning it on i want it to have the objects properties and not the layers properties where i placed it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"setbylayer" does the oposite, keeping the inside layers but changing the properties i wanto to change. And i found a very interesting "block layer to 0" lisp, but it changes everything to layer 0 and sets all inside objects properties to by layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im looking for some lisp that does the same but keeping the other properties as they are.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope somebody can help me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankyou very much&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 23:37:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986023#M65670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-07T23:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986375#M65671</link>
      <description>&lt;P&gt;Something like this you did not say how to pick block name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(vlax-for block (vla-get-blocks doc) 
(if   (= (vla-get-name block) "your block name")
(vlax-for ent block 
(vla-put-layer ent "0") 
)
)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Jan 2021 04:50:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986375#M65671</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-08T04:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986707#M65672</link>
      <description>&lt;P&gt;no, in my case i have several diferent blocks so i would like to pick various different blocks and aply the layer 0 to the objects inside those blocks. i'm not sure but starting with the "blok to layer0" lisp anyone can change the code to keep the other object properties unchanged.&lt;/P&gt;&lt;P&gt;here is the block to layer0 lisp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:blkto0 ( / idx lst sel )&lt;BR /&gt;(if (setq sel (ssget '((0 . "INSERT"))))&lt;BR /&gt;(repeat (setq idx (sslength sel))&lt;BR /&gt;(block-&amp;gt;0 (cdr (assoc 2 (entget (ssname sel (setq idx (1- idx)))))))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(command "_.regen")&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;(defun block-&amp;gt;0 ( blk / ent enx )&lt;BR /&gt;(cond&lt;BR /&gt;( (member blk lst))&lt;BR /&gt;( (setq ent (tblobjname "block" blk))&lt;BR /&gt;(while (setq ent (entnext ent))&lt;BR /&gt;(entmod (subst-append 8 "0" (subst-append 62 256 (setq enx (entget ent)))))&lt;BR /&gt;(if (= "INSERT" (cdr (assoc 0 enx)))&lt;BR /&gt;(block-&amp;gt;0 (cdr (assoc 2 enx)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(setq lst (cons blk lst))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(defun subst-append ( key val lst / itm )&lt;BR /&gt;(if (setq itm (assoc key lst))&lt;BR /&gt;(subst (cons key val) itm lst)&lt;BR /&gt;(append lst (list (cons key val)))&lt;BR /&gt;)&lt;BR /&gt;)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 08:40:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986707#M65672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-08T08:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986784#M65673</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some info you should know about AutoCAD block reference (insert). say you have some blocks reference in "layer1", if you freeze it, all blocks goes to 'sleep' &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;. so to answer your question, change all those blocks to some "sleep" layer,&amp;nbsp; and you can do it quickly using QSelect or SSX commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 09:27:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986784#M65673</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2021-01-08T09:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986842#M65674</link>
      <description>&lt;P&gt;yes, in the freeze case i realized that but if i wanto to turn layon or layoff all the other layers inside the block that are not in layer 0 stay on!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 09:59:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986842#M65674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-08T09:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986863#M65675</link>
      <description>&lt;P&gt;i prefer sending the block to 'sleep' layer (and freeze it) instead of modifying it and send it to 0 layer. doing &lt;SPAN&gt;latest&lt;/SPAN&gt; is more work and you are losing it's origin state. modify the block only if you have no other option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 10:14:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986863#M65675</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2021-01-08T10:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986928#M65676</link>
      <description>&lt;P&gt;i don't have any problem with that but i'm working with a team that only works with autocad sometimes and when they do, they want to be quick turning layers on and off instead of freezing it. The reason to ask for this kind of lisp is to regularize the blocks and have the same workflow for everyone in a template. They realized that changing inside block layers to 0 and keep other properties unchanged would do what they want but i have almost 300 bloks and have to get inside of each one, and do it manualy &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 10:47:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9986928#M65676</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-08T10:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987215#M65677</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... I was looking for a lisp that could change any objcects inside a block to layer 0 but i don't want to change its lintypes, linewights and colors. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try &lt;FONT color="#000000"&gt;&lt;STRONG&gt;BENL0CL.lsp&lt;/STRONG&gt;&lt;/FONT&gt;, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-all-block-element-to-layer-0-except-defpoints/m-p/5380291/highlight/true#M327253" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;[= &lt;FONT color="#000000"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/FONT&gt;lock &lt;FONT color="#000000"&gt;&lt;STRONG&gt;E&lt;/STRONG&gt;&lt;/FONT&gt;ntities, including in &lt;FONT color="#000000"&gt;&lt;STRONG&gt;N&lt;/STRONG&gt;&lt;/FONT&gt;ested blocks, to &lt;FONT color="#000000"&gt;&lt;STRONG&gt;L&lt;/STRONG&gt;&lt;/FONT&gt;ayer &lt;FONT color="#000000"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt; with &lt;FONT color="#000000"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/FONT&gt;olor &amp;amp; &lt;FONT color="#000000"&gt;&lt;STRONG&gt;L&lt;/STRONG&gt;&lt;/FONT&gt;inetype from entity's original layer].&amp;nbsp; {Note that there's a zero in the name, not a capital O.}&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;If you don't want to do it to parts of &lt;STRONG&gt;&lt;EM&gt;N&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;ested&lt;/EM&gt; Blocks, use the one earlier in that thread &lt;EM&gt;without&lt;/EM&gt; the &lt;STRONG&gt;N&lt;/STRONG&gt; in the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does what you want regarding colors and linetypes, lineweights can be added.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 13:10:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987215#M65677</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T13:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987455#M65678</link>
      <description>&lt;P&gt;yes, is somethig like this, but is not perfect. i noticed that the lisp changed the enteties to the layer properties but those enteties that are in "by layer" get the layer properties instead of remaining "by layer"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my mind i have the vision to enter inside the block select all objetcs and just change to layer 0, seams so simple but i don't have any idea how to do it in code &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 14:25:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987455#M65678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-08T14:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987519#M65679</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;yes, is somethig like this, but is not perfect. i noticed that the lisp changed the enteties to the layer properties but those enteties that are in "by layer" get the layer properties instead of remaining "by layer"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... to enter inside the block select all objetcs and just change to layer 0....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That seems to contradict your original description, "...&lt;SPAN&gt;change any objcects inside a block to layer 0 but i &lt;STRONG&gt;don't want to change its lintypes, linewights and colors&lt;/STRONG&gt;."&amp;nbsp; Does that not mean that if something is on a Layer that's red, you want it to change to being on Layer 0 but &lt;EM&gt;still be red&lt;/EM&gt;, because that's the color of its original Layer?&amp;nbsp; If an entity's properties that are ByLayer remain that way, and the entity is put on Layer 0, it &lt;STRONG&gt;&lt;EM&gt;will change its visible properties&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;[except any of them that happen to be the same as Layer 0's properties].&amp;nbsp; Is that what you want?&amp;nbsp; That's comparatively simple -- see my &lt;STRONG&gt;BENL0&lt;/STRONG&gt; command, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/beltb-lsp-multiple-blocks/m-p/9224162/highlight/true#M394190" target="_self"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 14:47:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987519#M65679</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T14:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987823#M65680</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;....&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;see my &lt;STRONG&gt;BENL0&lt;/STRONG&gt; command, &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/beltb-lsp-multiple-blocks/m-p/9224162/highlight/true#M394190" target="_self"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;... and you can incorporate the adjustment in the next Message there.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 16:22:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987823#M65680</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T16:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987825#M65681</link>
      <description>&lt;P&gt;i'm not a native english speaker so that's why i may have a little difficulty to express myself, i'm sorry&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;that's what i want, if in some cases there are "by layer" enteties inside the block, i want them to change as the "outside" layer of the block changes its visual porperties but all the other colors remain unchanged&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 16:22:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987825#M65681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-08T16:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987955#M65682</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;.... if in some cases there are "by layer" enteties inside the block, i want them to change as the "outside" layer of the block changes its visual porperties but all the other colors remain unchanged&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then yes, I think the &lt;FONT color="#000000"&gt;BENL0&lt;/FONT&gt; command will do what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 17:06:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9987955#M65682</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T17:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9988154#M65683</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;.... Try &lt;FONT color="#000000"&gt;&lt;STRONG&gt;BENL0CL.lsp&lt;/STRONG&gt; ...&lt;/FONT&gt;&amp;nbsp;&lt;SPAN&gt;[= &lt;FONT color="#000000"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/FONT&gt;lock &lt;FONT color="#000000"&gt;&lt;STRONG&gt;E&lt;/STRONG&gt;&lt;/FONT&gt;ntities, including in &lt;FONT color="#000000"&gt;&lt;STRONG&gt;N&lt;/STRONG&gt;&lt;/FONT&gt;ested blocks, to &lt;FONT color="#000000"&gt;&lt;STRONG&gt;L&lt;/STRONG&gt;&lt;/FONT&gt;ayer &lt;FONT color="#000000"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt; with &lt;FONT color="#000000"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/FONT&gt;olor &amp;amp; &lt;FONT color="#000000"&gt;&lt;STRONG&gt;L&lt;/STRONG&gt;&lt;/FONT&gt;inetype from entity's original layer].&amp;nbsp; ...&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;If it does what you want regarding colors and linetypes, lineweights can be added.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In case someone finds this and wants that kind of functionality but also including &lt;STRONG&gt;&lt;EM&gt;lineweights&lt;/EM&gt;&lt;/STRONG&gt;, attached is a modification that adds them, the cumbersomely-named&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;BENL0CLW.lsp&lt;/FONT&gt;&lt;/STRONG&gt;.&amp;nbsp; The second &lt;STRONG&gt;&lt;FONT color="#000000"&gt;L&lt;/FONT&gt;&lt;/STRONG&gt; is still for &lt;STRONG&gt;&lt;FONT color="#000000"&gt;L&lt;/FONT&gt;&lt;/STRONG&gt;inetype; the &lt;STRONG&gt;&lt;FONT color="#000000"&gt;W&lt;/FONT&gt;&lt;/STRONG&gt; is for line&lt;STRONG&gt;&lt;FONT color="#000000"&gt;W&lt;/FONT&gt;&lt;/STRONG&gt;eight.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 18:24:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9988154#M65683</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-08T18:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9991973#M65684</link>
      <description>&lt;P&gt;I think you are crazy to be subjecting layer "0" to freezing or turning off.&lt;/P&gt;
&lt;P&gt;I guess it's okay if you like masochism, but if you work with others on the same files, then your idea is criminal.&amp;nbsp; I trust you have a different vocation you can pursue.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 01:25:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/9991973#M65684</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-01-11T01:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/13069410#M65685</link>
      <description>&lt;P&gt;Replied to the wrong post Sorry to open this up again.&lt;BR /&gt;&lt;BR /&gt;See if this does what your looking for.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:fixblock (/ *error* adoc lst_layer func_restore-layers)

 (defun *error* (msg)
   (func_restore-layers)
   (vla-endundomark adoc)
   (princ msg)
   (princ)
   ) ;_ end of defun

 (defun func_restore-layers ()
   (foreach item lst_layer
     (vla-put-lock (car item) (cdr (assoc "lock" (cdr item))))
     (vl-catch-all-apply
       '(lambda ()
          (vla-put-freeze
            (car item)
            (cdr (assoc "freeze" (cdr item)))
            ) ;_ end of vla-put-freeze
          ) ;_ end of lambda
       ) ;_ end of vl-catch-all-apply
     ) ;_ end of foreach
   ) ;_ end of defun

 (vl-load-com)
 (vla-startundomark
   (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
   ) ;_ end of vla-startundomark
 (if (and (not (vl-catch-all-error-p
                 (setq selset
                        (vl-catch-all-apply
                          (function
                            (lambda ()
                              (ssget '((0 . "INSERT")))
                              ) ;_ end of lambda
                            ) ;_ end of function
                          ) ;_ end of vl-catch-all-apply
                       ) ;_ end of setq
                 ) ;_ end of vl-catch-all-error-p
               ) ;_ end of not
          selset
          ) ;_ end of and
   (progn
     (vlax-for item (vla-get-layers adoc)
       (setq
         lst_layer (cons (list item
                               (cons "lock" (vla-get-lock item))
                               (cons "freeze" (vla-get-freeze item))
                               ) ;_ end of list
                         lst_layer
                         ) ;_ end of cons
         ) ;_ end of setq
       (vla-put-lock item :vlax-false)
       (vl-catch-all-apply
         '(lambda () (vla-put-freeze item :vlax-false))
         ) ;_ end of vl-catch-all-apply
       ) ;_ end of vlax-for
     (foreach blk_def
              (mapcar
                (function
                  (lambda (x)
                    (vla-item (vla-get-blocks adoc) x)
                    ) ;_ end of lambda
                  ) ;_ end of function
                ((lambda (/ res)
                   (foreach item (mapcar
                                   (function
                                     (lambda (x)
                                       (vla-get-name
                                         (vlax-ename-&amp;gt;vla-object x)
                                         ) ;_ end of vla-get-name
                                       ) ;_ end of lambda
                                     ) ;_ end of function
                                   ((lambda (/ tab item)
                                      (repeat (setq tab  nil
                                                    item (sslength selset)
                                                    ) ;_ end setq
                                        (setq
                                          tab
                                           (cons
                                             (ssname selset
                                                     (setq item (1- item))
                                                     ) ;_ end of ssname
                                             tab
                                             ) ;_ end of cons
                                          ) ;_ end of setq
                                        ) ;_ end of repeat
                                      tab
                                      ) ;_ end of lambda
                                    )
                                   ) ;_ end of mapcar
                     (if (not (member item res))
                       (setq res (cons item res))
                       ) ;_ end of if
                     ) ;_ end of foreach
                   (reverse res)
                   ) ;_ end of lambda
                 )
                ) ;_ end of mapcar
       (vlax-for ent blk_def
         (vla-put-layer ent "0")
         (vla-put-color ent 0)
         (vla-put-lineweight ent aclnwtbyblock)
         (vla-put-linetype ent "byblock")
         ) ;_ end of vlax-for
       ) ;_ end of foreach
     (func_restore-layers)
     (vla-regen adoc acallviewports)
     ) ;_ end of progn
   ) ;_ end of if
 (vla-endundomark adoc)
 (princ)
 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been using it for a while. You can do singles or just pick all for everything in the DWG&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 14:56:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/13069410#M65685</guid>
      <dc:creator>LDShaw</dc:creator>
      <dc:date>2024-10-07T14:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/13084518#M65686</link>
      <description>&lt;P&gt;This lisp uses functionality borrowed from LEE MAC APPLY TO BLOCK OBJECTS&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.lee-mac.com/applytoblockobjects.html" target="_blank"&gt;Apply to Block Objects | Lee Mac Programming (lee-mac.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Its purpose is to set objects or objects inside the block to LAY 0 and set properties to BYLAY.&lt;/P&gt;&lt;P&gt;I created it because I did not see the same results from the SETBYLAYER command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should warn you in advance this is a GPT spinoff so if you have the skills to streamline or improve the operation please do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;-Tim C.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 02:03:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/13084518#M65686</guid>
      <dc:creator>tim_crouse</dc:creator>
      <dc:date>2024-10-15T02:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Change block objects to layer 0 and keep objects colors and other properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/13339901#M65687</link>
      <description>&lt;P&gt;Can this adjust to another conditions which is&lt;BR /&gt;ByBlock -&amp;gt; to follow ByLayer condition?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 04:33:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-objects-to-layer-0-and-keep-objects-colors-and/m-p/13339901#M65687</guid>
      <dc:creator>aliff_ahtenk</dc:creator>
      <dc:date>2025-02-26T04:33:53Z</dc:date>
    </item>
  </channel>
</rss>

