<?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: Is automatic seed update possible with Python? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67379#M947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that when Building is recursively called, GFAR is not recalculated.&amp;nbsp; It is initialized to a value (depending on the seed), and then it stays that same value as the rules are derived.&amp;nbsp; This creates an endless recursion.&amp;nbsp; Attributes are initialized at the beginning and don't change during rule derivation (unless they are specifically&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;set&lt;/SPAN&gt;).&amp;nbsp; Changing the seedian with python won't make GFAR change its value during rule derivation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest initializing all attributes to valid values independent of the rule derivation.&amp;nbsp; Perhaps you can initialize GFAR and BuildingX to values in the desired ranges and calculate the appropriate BuildingZ value from them.&amp;nbsp; It is also possible to use recursive functions to define your attributes before any rule derivation happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Aug 2019 13:26:05 GMT</pubDate>
    <dc:creator>CherylLau</dc:creator>
    <dc:date>2019-08-09T13:26:05Z</dc:date>
    <item>
      <title>Is automatic seed update possible with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67378#M946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;Hello guys, there is something I cant resolve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;In my project, I randomly determine the horizontal and vertical dimensions of buildings with cga rule.For example between 10-20 meters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;What I want to do is regenerate shape until BuildingFootprint Area / Parcel Area &amp;gt; 0.3 when &lt;SPAN&gt;BuildingFootprint Area / Parcel Area&amp;nbsp;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;0.3&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;My problem is ;&amp;nbsp; If the conditions do not occur, the cga rule does not regenerate the seed values.If conditions do not occur, can a python script be written to automatically update seed values and regenerate shapes until the condition occurs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If you can, can you help me with this, because I don't know about Python scripting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my cga rule :&lt;/P&gt;&lt;P&gt;*************************************************************************************&lt;/P&gt;&lt;P&gt;attr BuildingX = rand (8,30)&lt;BR /&gt;attr BuildingZ&amp;nbsp;= rand (8,30)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;attr&amp;nbsp;GFAR = BuildingX*BuildingZ/geometry.area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lot--&amp;gt;&lt;BR /&gt; split(x) { ~1 :&amp;nbsp;Space | BuildingX : split(z) { ~1 :&amp;nbsp;Space | &lt;SPAN&gt;BuildingZ&lt;/SPAN&gt;&amp;nbsp;: Building | ~1 :&amp;nbsp;Space } | ~1 :&amp;nbsp;Space }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Building--&amp;gt;&lt;BR /&gt; case&amp;nbsp;GFAR&amp;nbsp;&amp;gt; 0.3 :&amp;nbsp;Building&lt;BR /&gt; else:CorrectBuilding&lt;BR /&gt; &lt;BR /&gt;CorrectBuilding--&amp;gt;extrude(8)&lt;/P&gt;&lt;P&gt;***************************************************************************************&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2019 22:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67378#M946</guid>
      <dc:creator>MikeJane</dc:creator>
      <dc:date>2019-07-27T22:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is automatic seed update possible with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67379#M947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that when Building is recursively called, GFAR is not recalculated.&amp;nbsp; It is initialized to a value (depending on the seed), and then it stays that same value as the rules are derived.&amp;nbsp; This creates an endless recursion.&amp;nbsp; Attributes are initialized at the beginning and don't change during rule derivation (unless they are specifically&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;set&lt;/SPAN&gt;).&amp;nbsp; Changing the seedian with python won't make GFAR change its value during rule derivation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest initializing all attributes to valid values independent of the rule derivation.&amp;nbsp; Perhaps you can initialize GFAR and BuildingX to values in the desired ranges and calculate the appropriate BuildingZ value from them.&amp;nbsp; It is also possible to use recursive functions to define your attributes before any rule derivation happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 13:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67379#M947</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-08-09T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is automatic seed update possible with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67380#M948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the suggestion. The set function solves the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2019 21:34:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-automatic-seed-update-possible-with-python/m-p/67380#M948</guid>
      <dc:creator>MikeJane</dc:creator>
      <dc:date>2019-08-17T21:34:03Z</dc:date>
    </item>
  </channel>
</rss>

