<?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 Betreff: Change layer color to bylayer in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8027904#M104916</link>
    <description>&lt;P&gt;Don't be afraid to use the ActiveX Color property. The docs have claimed that it is obsolete and will be removed in 'future versions' for at least the past 10 years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IOW, it is the documentation itself that is 'obsolete'.&lt;/P&gt;&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/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;(vla-put-color (vlax-ename-&amp;gt;vla-object ABC) 256)&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;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 May 2018 05:03:41 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2018-05-26T05:03:41Z</dc:date>
    <item>
      <title>Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8003739#M104909</link>
      <description>&lt;P&gt;I'm trying to write a routine to change a selected object's color to Bylayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not as straightforward as I would have thought.&lt;/P&gt;&lt;P&gt;Change, Properties, Color wants a number.&amp;nbsp; Entity subobject list doesn't display the color associated pair when it is set that way.&amp;nbsp; So...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one object's name stored in a variable.&amp;nbsp; I want that object's color to be Bylayer.&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 17:55:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8003739#M104909</guid>
      <dc:creator>subs</dc:creator>
      <dc:date>2018-05-15T17:55:51Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8003762#M104910</link>
      <description>&lt;P&gt;(setq ABC (car(entsel)))&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;(setq ABC (ssget))&lt;/P&gt;
&lt;P&gt;(command "_.CHPROP" ABC "" "_color" "ByLAyer" "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;__&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;(setq elist (entget ABC))&lt;/P&gt;
&lt;P&gt;(if (assoc 62 elist)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (entmod (subst '(62 . 256) (assoc 62 elist)elist))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (entmod (cons '(62 . 256) elist))&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;(vla-put-color (vlax-ename-&amp;gt;vla-object ABC) 256)&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>Tue, 15 May 2018 18:05:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8003762#M104910</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2018-05-15T18:05:55Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8003803#M104911</link>
      <description>&lt;P&gt;Awesome!&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 18:23:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8003803#M104911</guid>
      <dc:creator>subs</dc:creator>
      <dc:date>2018-05-15T18:23:42Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8004836#M104912</link>
      <description>&lt;P&gt;Is your goal to use this routine as part of a larger one?&lt;/P&gt;&lt;P&gt;If not, you can also use the standard AutoCAD command SETBYLAYER to change the object's color to ByLayer.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 05:49:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8004836#M104912</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2018-05-16T05:49:32Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8005862#M104913</link>
      <description>&lt;P&gt;Yes, it's part of a larger program.&amp;nbsp; Normally, without programming,&amp;nbsp;I would select a group of objects and just change the layer in the properties window.&amp;nbsp; I didn't know about that command, so thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started using a program that creates contours on a pointcloud.&amp;nbsp; I import that into CAD, but the major and minor contours are set to a specific color.&amp;nbsp; I want to put the major and minors on their own layer set to Bylayer so when I hand the drawing off to the client, they can change the colors by simply changing the layer color.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also want to thicken the major contours, but a problem I have is most contours are polylines and a few are lines.&amp;nbsp; When I have only polylines selected, I can change the global width in the properties dialog.&amp;nbsp; If a mixture of polyline and lines are selected, there is no thickness option in the dialog.&amp;nbsp; I know when I try to PEdit and line, it asks if I want to change it to a poly, then I can give it width.&amp;nbsp; Is there a command that changes lines to polys?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to completely automate the process by just running the program and it selects all the polys (or steps through the database one by one (entnext) checking if it is a poly, converting it to a poly if it is a line, checking the entity's color and if a major contour, changing it to the major contour layer, making color bylayer and adding thickness.&amp;nbsp; If the current color is a minor contour, setting it to bylayer and moving it to the minor contour layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to do all of that except converting an entity to a polyline from a line.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 13:21:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8005862#M104913</guid>
      <dc:creator>subs</dc:creator>
      <dc:date>2018-05-16T13:21:21Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8006217#M104914</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/autocad-forum/converting-the-lines-to-polylines/td-p/3293191" target="_blank"&gt;https://forums.autodesk.com/t5/autocad-forum/converting-the-lines-to-polylines/td-p/3293191&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 15:06:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8006217#M104914</guid>
      <dc:creator>roland.r71</dc:creator>
      <dc:date>2018-05-16T15:06:45Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8006427#M104915</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;(setq ABC (car(entsel)))&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;(setq ABC (ssget))&lt;/P&gt;
&lt;P&gt;(command "_.CHPROP" ABC "" "_color" "ByLAyer" "")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;__&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;(setq elist (entget ABC))&lt;/P&gt;
&lt;P&gt;(if (assoc 62 elist)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (entmod (subst '(62 . 256) (assoc 62 elist)elist))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (entmod (cons '(62 . 256) elist))&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;(vla-put-color (vlax-ename-&amp;gt;vla-object ABC) 256)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In the ActiveX documentation, the "Color" property is noted as&amp;nbsp;obsolete.&amp;nbsp; While it still works, it's probably better to use the TrueColor property and assign it a TrueColor interface object (create one interface object outside the loop, then assign it to the different objects inside the loop).&amp;nbsp; There's a few other benefits to doing it that way, including some useful properties and conversion methods for non-ACI colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And have a look in the ActiveX API for the constants which can make the code a bit more readable, such as "acByLayer", "acByBlock", "acRed", etc.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 16:27:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8006427#M104915</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2018-05-16T16:27:37Z</dc:date>
    </item>
    <item>
      <title>Betreff: Change layer color to bylayer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8027904#M104916</link>
      <description>&lt;P&gt;Don't be afraid to use the ActiveX Color property. The docs have claimed that it is obsolete and will be removed in 'future versions' for at least the past 10 years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IOW, it is the documentation itself that is 'obsolete'.&lt;/P&gt;&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/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;(vla-put-color (vlax-ename-&amp;gt;vla-object ABC) 256)&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;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 05:03:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-layer-color-to-bylayer/m-p/8027904#M104916</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2018-05-26T05:03:41Z</dc:date>
    </item>
  </channel>
</rss>

