<?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 Colorizing Polygons based on an object attribute in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682499#M8985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've imported some shapes from ArcMap into CE and I am trying to create the same symbology that I had created, based values taken from their "Solar_Potential" attribute. I would very much appreciate some assistance with writing a rule that assigns a color to the imported shapes that have a certain value, (such as #FF0000 for Solar_Potential value of 3, #FFCC00 for Solar_Potential value of 2, etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Oct 2012 21:01:35 GMT</pubDate>
    <dc:creator>ScottFujikawa</dc:creator>
    <dc:date>2012-10-30T21:01:35Z</dc:date>
    <item>
      <title>Colorizing Polygons based on an object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682499#M8985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've imported some shapes from ArcMap into CE and I am trying to create the same symbology that I had created, based values taken from their "Solar_Potential" attribute. I would very much appreciate some assistance with writing a rule that assigns a color to the imported shapes that have a certain value, (such as #FF0000 for Solar_Potential value of 3, #FFCC00 for Solar_Potential value of 2, etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2012 21:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682499#M8985</guid>
      <dc:creator>ScottFujikawa</dc:creator>
      <dc:date>2012-10-30T21:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Colorizing Polygons based on an object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682500#M8986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had a similar thing in mine, where I wanted different zones particular colours based on the zone attribute from the imported ArcGIS shapefile. What you need to do is write in the attribute to tell the rule file to search the shapefile for your "Solar_Potential" attribute and then use the conidtional rule. eg: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;attr Solar_Potential = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this will tell it to search the shapefile for the attribute called Solar_Potential, or if the values are non numerical use ""&amp;nbsp; //Then add in the conidtional rule&amp;nbsp; SolarPotentialColor =&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case Solar_Potential == 3 : ("#FF0000") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case Solar_Potential == 2 : ("#FFCC00") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else : ("#FFFFFF")&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then when you're writing your code all you have to do is eg. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;building--&amp;gt; color(SolarPotentialColor)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and it'll add in the corresponding colour! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2012 22:14:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682500#M8986</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2012-10-30T22:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Colorizing Polygons based on an object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682501#M8987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ms O'Brien,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your help in writing the cga file for colorizing the roof polygons. I need to find a source for all the cga grammar. The only change I made to your suggestion was to use "Lot --&amp;gt;"&amp;nbsp; because it wouldn't compile for me when I used "Building --&amp;gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The results look great, just like what I had in ArcMap.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 14:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682501#M8987</guid>
      <dc:creator>ScottFujikawa</dc:creator>
      <dc:date>2012-11-01T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Colorizing Polygons based on an object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682502#M8988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The best sources for learning cga is to go through the tutorials (especially the basic and advanced cga coding ones). There are video's associated with them online here: &lt;/SPAN&gt;&lt;A href="http://video.arcgis.com/series/62/cityengine"&gt;http://video.arcgis.com/series/62/cityengine&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also read through the help files on cityengine, they're really useful once you get into it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the 'Building' not working, it depends what you're assigned as your StartRule in the Inspector window. The default is 'Lot' hence this worked for you, but this can be changed if you want to use a different start rule, for example if you have multiple startrules in one rule file. (if you're doing this use @StartRule above each rule to indicate which one's are new rules.This is useful when you want to use all the same attributes etc but split the building up differently etc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 18:58:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682502#M8988</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2012-11-01T18:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Colorizing Polygons based on an object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682503#M8989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What you want to do it link your code to the string, which is your hex values so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr lineColor = "" # these double quotation marks are what you use for linking to a sting in the attribute tables.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#also note that the attr name must be the exact same as the name in your object attr table&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That should be all you need, the rest of your code looks good. hope it works now! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:42:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/colorizing-polygons-based-on-an-object-attribute/m-p/682503#M8989</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2021-12-12T04:42:46Z</dc:date>
    </item>
  </channel>
</rss>

