<?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: Unespected token error in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/unespected-token-error/m-p/743896#M9760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, remove line 11.&amp;nbsp; You can't define functions inside a rule (e.g. Colour --&amp;gt; ...this is the inside part of the rule that I mean), and you don't need to have a function here.&amp;nbsp; (Alternatively, though, you could specify a function that returns a hexadecimal string for the color, and then the rule would call the function inside &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;color&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, the color operation takes in a string for a hexadecimal color, so you need to put the string inside quotation marks:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;color("#ffffff")‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-color.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-color.htm"&gt;color operation—CGA | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Third, the start rule annotation should have some capital letters:&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;@StartRule&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-930AD73F-8B93-4634-AA8D-EB0A08AC367F" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-930AD73F-8B93-4634-AA8D-EB0A08AC367F"&gt;Annotations—CGA | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2019 07:37:43 GMT</pubDate>
    <dc:creator>CherylLau</dc:creator>
    <dc:date>2019-09-12T07:37:43Z</dc:date>
    <item>
      <title>Unespected token error</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/unespected-token-error/m-p/743895#M9759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to color some land shapes according to their description (the attribute is called descriptiv), i'm really new to city engine and can't understand what it's wrong, but it keeps giving me an unespected token error. The code I'm using is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr descriptiv = "" &lt;BR /&gt;@startrule&lt;BR /&gt;Colour--&amp;gt;&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;&amp;nbsp;&lt;BR /&gt;color(descriptiv)=&lt;BR /&gt;case descriptiv == "building" :color(#8c5111)&amp;nbsp; #in this line I keep having "unespected token: case" and "unespected token: ="&lt;BR /&gt;case descriptiv == "general surface" :color(#2adbb2)&lt;BR /&gt;case descriptiv == "glasshouse" :color(#bae8e6)&lt;BR /&gt;case descriptiv == "Inland water" :color(#6ff1fc)&lt;BR /&gt;case descriptiv == "Inland water" :color(#6ff1fc)&lt;BR /&gt;case descriptiv == "landform" :color(#809c95)&lt;BR /&gt;case descriptiv == "natural environment" :color(#2c9171)&lt;BR /&gt;case descriptiv == "path" :color(#dec381)&lt;BR /&gt;case descriptiv == "rail" :color(#4a4948)&lt;BR /&gt;case descriptiv == "road or track" :color(#808080)&lt;BR /&gt;case descriptiv == "Roadside" :color(#adadad)&lt;BR /&gt;case descriptiv == "structure" :color(#ebebeb)&lt;BR /&gt;else :color(#ffffff)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 14:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/unespected-token-error/m-p/743895#M9759</guid>
      <dc:creator>Francesca_Nappo</dc:creator>
      <dc:date>2019-09-11T14:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unespected token error</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/unespected-token-error/m-p/743896#M9760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, remove line 11.&amp;nbsp; You can't define functions inside a rule (e.g. Colour --&amp;gt; ...this is the inside part of the rule that I mean), and you don't need to have a function here.&amp;nbsp; (Alternatively, though, you could specify a function that returns a hexadecimal string for the color, and then the rule would call the function inside &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;color&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, the color operation takes in a string for a hexadecimal color, so you need to put the string inside quotation marks:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;color("#ffffff")‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-color.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-color.htm"&gt;color operation—CGA | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Third, the start rule annotation should have some capital letters:&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;@StartRule&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-930AD73F-8B93-4634-AA8D-EB0A08AC367F" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-930AD73F-8B93-4634-AA8D-EB0A08AC367F"&gt;Annotations—CGA | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 07:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/unespected-token-error/m-p/743896#M9760</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-09-12T07:37:43Z</dc:date>
    </item>
  </channel>
</rss>

