<?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: Autocad change colour script help in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989271#M61108</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I understand, I dont need to make a layer as the layers are already there in the DWG file (see Attachment 1) These layers in the attachment have a default colour which I need to change using a script to a colours from my colour book. (See attachment 2) here you see the content of the script - it contains all possible layer names and what colour from the colour book they should have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I try to run the script, and one of the layers is missing (which happens, not all files will contain the entire list of these layers some can have 5 layers from the list and other can have 12+) it fails with the following command:&amp;nbsp;Cannot find layer "FEATURES", this can happen to any layer that is not present.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its very strange, as the script works when it only has a list of layers that are currently present in the DWG file - So for example if Terrain, Road, Greenspace are the only layers and script only contains these 3 then it works. But I can not make individual scripts for individual files as it destroys the idea of having to change these colours quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence why I am trying to see if someone knows why the script would not work. I am taking this on from someone who is no longer present so any input or suggestions are very welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Attachment 1.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1033349iECFCA76AE53816BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Attachment 1.jpg" alt="Attachment 1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Attachment 2.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1033350iA47C92727FDD99B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Attachment 2.jpg" alt="Attachment 2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 18:23:22 GMT</pubDate>
    <dc:creator>miloRTZPE</dc:creator>
    <dc:date>2022-03-07T18:23:22Z</dc:date>
    <item>
      <title>Autocad change colour script help</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989150#M61106</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to to make a script work for my AutoCAD, script that changes layer colours to one in my colour book - I have a set of commands already like: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-LAYER&lt;BR /&gt;Set&lt;BR /&gt;FEATURES&lt;BR /&gt;Color&lt;BR /&gt;COlorbook&lt;BR /&gt;Color Book One&lt;BR /&gt;Terrain&lt;BR /&gt;FEATURES&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which works, however sometimes a certain file is missing a layer from that list and therefore the script fails. Is there a way to make its o the script ignores the missing layer and moves to the next command? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:21:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989150#M61106</guid>
      <dc:creator>miloRTZPE</dc:creator>
      <dc:date>2022-03-07T17:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad change colour script help</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989204#M61107</link>
      <description>the MAKE option in -LAYER command not only SETs the layer as active, but if it is missing it will go ahead and create it too.&lt;BR /&gt;&lt;BR /&gt;Experiment an rewrite your script.</description>
      <pubDate>Mon, 07 Mar 2022 17:49:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989204#M61107</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2022-03-07T17:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad change colour script help</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989271#M61108</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I understand, I dont need to make a layer as the layers are already there in the DWG file (see Attachment 1) These layers in the attachment have a default colour which I need to change using a script to a colours from my colour book. (See attachment 2) here you see the content of the script - it contains all possible layer names and what colour from the colour book they should have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I try to run the script, and one of the layers is missing (which happens, not all files will contain the entire list of these layers some can have 5 layers from the list and other can have 12+) it fails with the following command:&amp;nbsp;Cannot find layer "FEATURES", this can happen to any layer that is not present.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its very strange, as the script works when it only has a list of layers that are currently present in the DWG file - So for example if Terrain, Road, Greenspace are the only layers and script only contains these 3 then it works. But I can not make individual scripts for individual files as it destroys the idea of having to change these colours quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence why I am trying to see if someone knows why the script would not work. I am taking this on from someone who is no longer present so any input or suggestions are very welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Attachment 1.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1033349iECFCA76AE53816BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Attachment 1.jpg" alt="Attachment 1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Attachment 2.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1033350iA47C92727FDD99B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Attachment 2.jpg" alt="Attachment 2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 18:23:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989271#M61108</guid>
      <dc:creator>miloRTZPE</dc:creator>
      <dc:date>2022-03-07T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad change colour script help</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989426#M61109</link>
      <description>One more time, the MAKE option in -LAYER command&lt;BR /&gt;1) can  SET the layer as active if it is present&lt;BR /&gt;2) but if it is missing it will go ahead and create it then SET it.&lt;BR /&gt;&lt;BR /&gt;It has a dual function, all in one.&lt;BR /&gt;&lt;BR /&gt;Stop using SET only: start using MAKE instead.&lt;BR /&gt;&lt;BR /&gt;Try again.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2022 19:49:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989426#M61109</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2022-03-07T19:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad change colour script help</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989832#M61110</link>
      <description>&lt;P&gt;Oh my yes! I I understood it finally! sorry!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked! However, like you said it creates empty layers and colours them in - Is there a purge all command I can add at the end?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Purge&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;O&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the above didnt work - any suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 22:43:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10989832#M61110</guid>
      <dc:creator>miloRTZPE</dc:creator>
      <dc:date>2022-03-07T22:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Autocad change colour script help</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10991167#M61111</link>
      <description>PURGE command will not remove active/set layers: otherwise it works just fine.</description>
      <pubDate>Tue, 08 Mar 2022 13:54:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-change-colour-script-help/m-p/10991167#M61111</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2022-03-08T13:54:36Z</dc:date>
    </item>
  </channel>
</rss>

