<?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: Adding base shape colour to Plant_Loader.cga in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125610#M1712</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason why the ground cover doesn't work in the code above is because the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; sets the size of the shape to zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend making a new rule that imports the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; instead of modifying the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; itself.&amp;nbsp; That way, if a new version of the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; becomes available later, you can update to the new version.&amp;nbsp; On the initial shape, you can call the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; and also create the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;GroundCover&lt;/SPAN&gt;.&amp;nbsp; The same goes&amp;nbsp;for the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Distributor&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import Plant_Loader:"/ESRI.lib/rules/Plants/Plant_Loader.cga"

Lot --&amp;gt;
	Plant_Loader.Generate
	GroundCover
	
GroundCover --&amp;gt;
	color("#948477")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:09:01 GMT</pubDate>
    <dc:creator>CherylLau</dc:creator>
    <dc:date>2021-12-11T07:09:01Z</dc:date>
    <item>
      <title>Adding base shape colour to Plant_Loader.cga</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125609#M1711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have managed to successfully add a generic brown (mulch) colour to the Plant_Distributor.cga by adding GroundCover to the existing rule:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@StartRule&lt;BR /&gt;Generate --&amp;gt;&lt;BR /&gt; case Mix == "Custom":&lt;BR /&gt; alignScopeToAxes(y)&lt;BR /&gt; comp(f){ vertical: NIL | bottom: NIL | all= CustomMix }&lt;BR /&gt; GroundCover&lt;BR /&gt; else:&lt;BR /&gt; alignScopeToAxes(y)&lt;BR /&gt; comp(f){ vertical: NIL | bottom: NIL | all= Generate(_getMix) }&lt;BR /&gt; GroundCover&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GroundCover --&amp;gt;&lt;BR /&gt; color("#948477")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works and adds a brown base colour to the shapes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to do that to Plant_Loader.cga with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@StartRule # assumes that all main attributes have been set outside&lt;BR /&gt;Generate --&amp;gt; &lt;BR /&gt; case Height &amp;gt; 0:&lt;BR /&gt; set(_plantNbr,_indexFromCommonName(Name))&lt;BR /&gt; set(_plantName,_validate(Name))&lt;BR /&gt; set(_plantHeight,Height)&lt;BR /&gt; set(_plantRadius,Radius)&lt;BR /&gt; s(0,0,0) center(xyz) &lt;BR /&gt; alignScopeToAxes(y)&lt;BR /&gt; TrunkOrigin&lt;BR /&gt; GroundCover&lt;BR /&gt; &lt;BR /&gt; else:&lt;BR /&gt; Generate(Name)&lt;BR /&gt; GroundCover&lt;BR /&gt; &lt;BR /&gt;GroundCover --&amp;gt;&lt;BR /&gt; color("#948477")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Shape does not receive a colour and stays to generic base colour.&lt;/P&gt;&lt;P&gt;Can someone explain what I am doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2020 03:17:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125609#M1711</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-07-01T03:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding base shape colour to Plant_Loader.cga</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125610#M1712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason why the ground cover doesn't work in the code above is because the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; sets the size of the shape to zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend making a new rule that imports the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; instead of modifying the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; itself.&amp;nbsp; That way, if a new version of the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; becomes available later, you can update to the new version.&amp;nbsp; On the initial shape, you can call the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Loader&lt;/SPAN&gt; and also create the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;GroundCover&lt;/SPAN&gt;.&amp;nbsp; The same goes&amp;nbsp;for the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Plant_Distributor&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import Plant_Loader:"/ESRI.lib/rules/Plants/Plant_Loader.cga"

Lot --&amp;gt;
	Plant_Loader.Generate
	GroundCover
	
GroundCover --&amp;gt;
	color("#948477")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125610#M1712</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2021-12-11T07:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding base shape colour to Plant_Loader.cga</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125611#M1713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much, I really appreciate it!&lt;/P&gt;&lt;P&gt;It can be so simple sometimes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2020 21:09:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adding-base-shape-colour-to-plant-loader-cga/m-p/125611#M1713</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-07-08T21:09:31Z</dc:date>
    </item>
  </channel>
</rss>

