<?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: Store a Shape in CGA in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116188#M1608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my knowledge this won't be possible with CGA alone. CGA only goes in one direction, and you'd have to return to a previous state. You can call a previous rule, but it'll be applied to the current state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to re-run the rule until the area condition is met. Remove the recursion and run the script until the object is generated. Don't forget to update the seed, or you'll always get the same "random" numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can either do it manually (ugh) or automatically with Python (using reporting to export a variable to check in a loop).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Aug 2017 00:11:49 GMT</pubDate>
    <dc:creator>LR</dc:creator>
    <dc:date>2017-08-11T00:11:49Z</dc:date>
    <item>
      <title>Store a Shape in CGA</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116183#M1603</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'm wondering if there is a way to store a parent shape to refer back to in CGA. I used the shapeO operation to randomly generate O-shaped area. And then I ran a comparison to see if the area is greater than a certain threshold. If not, I want to regenerate the O-shaped area again until it meets the criteria. My current cga creates a recursion. But I was wondering if I can get a hold of the parent shape the OShape was generated from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;OShape --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;shapeO(rand(0, 5), rand(0,50), rand(0, 20), rand(0,20)){shape:X|remainder: Calc}
Calc --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;case geometry.area &amp;gt; 60:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;extrude(10)
&amp;nbsp;&amp;nbsp;&amp;nbsp;else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OShape&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers are appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lesi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:50:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116183#M1603</guid>
      <dc:creator>LesiMai1</dc:creator>
      <dc:date>2021-12-11T06:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Store a Shape in CGA</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116184#M1604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could store attributes in variables, like this:&amp;nbsp;&lt;STRONG&gt;set(initialArea, geometry.area)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2017 11:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116184#M1604</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-08-08T11:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Store a Shape in CGA</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116185#M1605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply! I may not have been clear when I posted the question. But I'm wondering if there is a way to store the actual shape but not just the attributes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2017 05:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116185#M1605</guid>
      <dc:creator>LesiMai1</dc:creator>
      <dc:date>2017-08-09T05:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Store a Shape in CGA</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116186#M1606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can. What are you trying to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can more or less store a shape with Python (getVertices and getAttribute), if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2017 22:47:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116186#M1606</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-08-09T22:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Store a Shape in CGA</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116187#M1607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to generate a shape with random dimensions on a lot. But if the area of the new shape is under a certain threshold, I want to regenerate the shape until it meets the criteria.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 15:26:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116187#M1607</guid>
      <dc:creator>LesiMai1</dc:creator>
      <dc:date>2017-08-10T15:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Store a Shape in CGA</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116188#M1608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my knowledge this won't be possible with CGA alone. CGA only goes in one direction, and you'd have to return to a previous state. You can call a previous rule, but it'll be applied to the current state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to re-run the rule until the area condition is met. Remove the recursion and run the script until the object is generated. Don't forget to update the seed, or you'll always get the same "random" numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can either do it manually (ugh) or automatically with Python (using reporting to export a variable to check in a loop).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 00:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/store-a-shape-in-cga/m-p/116188#M1608</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-08-11T00:11:49Z</dc:date>
    </item>
  </channel>
</rss>

