<?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 I'm looking for a lisp routine to change layer color based on layer name in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548626#M143084</link>
    <description>&lt;P&gt;Does anyone have a lisp routine to change layer colors based on suffex of layer name? I have some files that need a quick turn around time&amp;nbsp;in printing many files, I don't have original pc3 file so I have to use our print scheme. Quickest way so far is to change colors in layer properties but it would be nice to have it happen as a function.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2015 14:59:51 GMT</pubDate>
    <dc:creator>David125</dc:creator>
    <dc:date>2015-03-19T14:59:51Z</dc:date>
    <item>
      <title>I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548626#M143084</link>
      <description>&lt;P&gt;Does anyone have a lisp routine to change layer colors based on suffex of layer name? I have some files that need a quick turn around time&amp;nbsp;in printing many files, I don't have original pc3 file so I have to use our print scheme. Quickest way so far is to change colors in layer properties but it would be nice to have it happen as a function.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 14:59:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548626#M143084</guid>
      <dc:creator>David125</dc:creator>
      <dc:date>2015-03-19T14:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548641#M143085</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/487809"&gt;@David125&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Does anyone have a lisp routine to change layer colors based on suffex of layer name? I have some files that need a quick turn around time&amp;nbsp;in printing many files, I don't have original pc3 file so I have to use our print scheme. Quickest way so far is to change colors in layer properties but it would be nice to have it happen as a function.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sounds easy enough, what are the conditions?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What about Layerstates Manager? that would work&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 15:10:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548641#M143085</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2015-03-19T15:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548707#M143086</link>
      <description>&lt;P&gt;I'd like set a color for all "-N" and "-NEW" layers to be a color assigned by user. I might have slight variations based on client input. Same goes for all "-D" and "-DEMO" layers. These would always be suffex of layer names. So, at prompt if it would ask for color to use on all new layers then prompt for color of all DEMO layers, then it would change color of all applicable layers in drawing. The drawing would be a sheet with xrefs attached, so I'd like to be able to change color of attached layers. I understand referenced drawing is not changed. It also seems possible that I could at a later time go into the reference and change the layer colors with the same routine.&lt;/P&gt;&lt;P&gt;If the suffex could be assingned by the user that would be great, but can survive without it. Is that enought information?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you apply a wildcard with layer states manager? As in to search for "-*NEW" layers and make them blue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still that is something I would have to do one drawing at a time. A lisp routine would allow me to apply the routine to many drawings useing batchscript to run it on many drawings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 15:33:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548707#M143086</guid>
      <dc:creator>David125</dc:creator>
      <dc:date>2015-03-19T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548761#M143087</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/487809"&gt;@David125&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I'd like set a color for all "-N" and "-NEW" layers to be a color assigned by user. ....&amp;nbsp; Same goes for all "-D" and "-DEMO" layers. ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For that particular situation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:LCS (/ colorN colorD); = Layer Color by Suffix&lt;BR /&gt;&amp;nbsp; (setq&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colorN (getstring "\nColor for -N and -NEW Layers: ")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colorD (getstring "\nColor for -D and -DEMO Layers: ")&lt;BR /&gt;&amp;nbsp; ); setq&lt;BR /&gt;&amp;nbsp; (command "_.layer"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" colorN "*-N,*-NEW"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" colorD "*-D,*-DEMO"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ""&lt;BR /&gt;&amp;nbsp; ); command&lt;BR /&gt;); defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It can easily be made to ask for the suffix, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 15:59:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/5548761#M143087</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-03-19T15:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6364381#M143088</link>
      <description>&lt;P&gt;Hi, I am looking for something very similar. We have an xref with multiple layers that have different prefixes (job numbers) but always have "(Master-E) New" or &amp;nbsp; &amp;nbsp; "(Master-E) EXR" in it. Is there a way to make a lisp very similar to this that just changes the color of those layers?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 13:51:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6364381#M143088</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-03T13:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6365630#M143089</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;.... We have an xref with multiple layers that have different prefixes (job numbers) but always have "(Master-E) New" or &amp;nbsp; &amp;nbsp; "(Master-E) EXR" in it. Is there a way to make a lisp very similar to this that just changes the color of those layers?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want the &lt;EM&gt;same&lt;/EM&gt; color for both categories, use wildcard *'s at &lt;EM&gt;both&lt;/EM&gt; ends of those substrings if there might be more Layer name after the target part, and comma-delimited multiple Layer names:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:LCME (/ col); = Layer Color by&amp;nbsp;Master-E&lt;BR /&gt;&amp;nbsp; (setq col (getstring "\nColor for (Master-E) New&amp;nbsp;and&amp;nbsp;(Master-E) EXR Layers: "))&lt;BR /&gt;&amp;nbsp; (command "_.layer" "_color" col "*(Master-E) New*,*(Master-E) EXR*" "")&lt;BR /&gt;); defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or a version without any variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:LCME (); = Layer Color by&amp;nbsp;Master-E&lt;BR /&gt;&amp;nbsp; (command&amp;nbsp;"_.layer"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" (getstring "\nColor for (Master-E) New&amp;nbsp;and&amp;nbsp;(Master-E) EXR Layers: ")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"*(Master-E) New*,*(Master-E) EXR*"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ); command&lt;/P&gt;
&lt;P&gt;); defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want &lt;EM&gt;different&lt;/EM&gt; colors for the two categories, change the names, and include * at the ends:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:LCME (/ colN colE); = Layer Color by&amp;nbsp;Master-E&lt;BR /&gt;&amp;nbsp; (setq&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colN (getstring "\nColor for (Master-E) New Layers: ")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colE (getstring "\nColor for (Master-E) EXR Layers: ")&lt;BR /&gt;&amp;nbsp; ); setq&lt;BR /&gt;&amp;nbsp; (command "_.layer"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" colN "*(Master-E) New*"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" colE "*(Master-E) EXR*"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ""&lt;BR /&gt;&amp;nbsp; ); command&lt;BR /&gt;); defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or just:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:LCME (); = Layer Color by&amp;nbsp;Master-E&lt;BR /&gt;&amp;nbsp; (command "_.layer"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" (getstring "\nColor for (Master-E) New Layers: ") "*(Master-E) New*"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" (getstring "\nColor for (Master-E) EXR Layers: ") "*(Master-E) EXR*"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ""&lt;BR /&gt;&amp;nbsp; ); command&lt;BR /&gt;); defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either could be made to be &lt;EM&gt;not case-sensitive&lt;/EM&gt;, if needed, and/or could be made to &lt;EM&gt;verify valid color input&lt;/EM&gt;, and probably some more things.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 02:29:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6365630#M143089</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-06-04T02:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6366533#M143090</link>
      <description>&lt;P&gt;Thank you very much. Is there any way to instead of asking for the color to just put in a color. For example color 8 for EXR and 3 for New?&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jun 2016 13:39:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6366533#M143090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-05T13:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: I'm looking for a lisp routine to change layer color based on layer name</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6375226#M143091</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much. Is there any way to instead of asking for the color to just put in a color. For example color 8 for EXR and 3 for New?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Certainly. &amp;nbsp;Try out the Layer command in the command-line usage by typing -Layer [with the hyphen prefix], and experiment with the prompts and options, and you'll be able to figure out how to do any of this stuff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(defun C:LCME (); = Layer Color by&amp;nbsp;Master-E&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; (command "_.layer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" "8" "*(Master-E) New*"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "_color" "3" "*(Master-E) EXR*"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ); command&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;); defun&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One thing that might not be obvious is that I believe [I'm not on a computer with AutoCAD to confirm] that even with a numerical color, you need to include double-quotes around it, since the possibility of color &lt;EM&gt;words&lt;/EM&gt;&amp;nbsp;such as "red" requires that it be given a &lt;EM&gt;string&lt;/EM&gt;, not a "raw" number.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 15:25:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-m-looking-for-a-lisp-routine-to-change-layer-color-based-on/m-p/6375226#M143091</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-06-09T15:25:47Z</dc:date>
    </item>
  </channel>
</rss>

