<?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: Variables storage in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40759#M557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Exactly! For me, one the great things added in these recent versions of CE was the capability to use "set()" with attributes defined by us. Things get much cleaner...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&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>Wed, 04 Apr 2012 07:42:37 GMT</pubDate>
    <dc:creator>AndréCardoso</dc:creator>
    <dc:date>2012-04-04T07:42:37Z</dc:date>
    <item>
      <title>Variables storage</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40755#M553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to store a value at some point in the code so I can use it later - for example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to determine a building's height based on the plot size and its footprint (in order to get my FAr right). So I need to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Measure the plot - geometry.area and save it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. create the building footprint with ShapeL (or offset / ShapeU....) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. now calculate based on a target FAR the height of the building (FAR = plot area / (footprint * no. of stories))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. extrude the building to the required height&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its just that once I've done the shapeU operation I cannot go back to read the plot area as geometry.area(bottom) will now give me the building footprint.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried with assigning the value to a new attr on the Lot rule (just before I divide them) but this doesn't seem to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p.s. working with really tedious urban planners - you know how they can sometimes be &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 13:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40755#M553</guid>
      <dc:creator>TalAisenberg</dc:creator>
      <dc:date>2012-04-03T13:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Variables storage</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40756#M554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure what you have tried to do already ... but have you tried to use the "set(attr, attrValue)" function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
@Hidden
attr originalArea = 0

Lot --&amp;gt;
&amp;nbsp;&amp;nbsp; print("Original Area", geometry.area)
&amp;nbsp;&amp;nbsp; set(originalArea, geometry.area)
&amp;nbsp;&amp;nbsp; BuildShape

BuildShape --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapeL(3, 4){shape: ShapeRule | remainder: NIL}

ShapeRule --&amp;gt;
&amp;nbsp;&amp;nbsp; alignScopeToAxes(y)
&amp;nbsp;&amp;nbsp; print("Original Area Again", originalArea)
&amp;nbsp;&amp;nbsp; print("Current Shape area", geometry.area)
&amp;nbsp;&amp;nbsp; extrude(world.y, originalArea/8) # calculate height in function of oriignal footprint area
&amp;nbsp;&amp;nbsp; Shape.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does it work?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:35:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40756#M554</guid>
      <dc:creator>AndréCardoso</dc:creator>
      <dc:date>2021-12-10T21:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Variables storage</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40757#M555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another possibility is just to pass the original area down to the next rules, as Rule parameters... &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Lot --&amp;gt; 
Rule2(geometry.area)

Rule2(area) --&amp;gt;
Rule3(area)

...
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:35:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40757#M555</guid>
      <dc:creator>AndréCardoso</dc:creator>
      <dc:date>2021-12-10T21:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variables storage</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40758#M556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brilliant, Set does the trick.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem with the second option is that I only need to use the variable in routines 4 or 5 levels down so bit cumbersome to pass it on and on. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 07:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40758#M556</guid>
      <dc:creator>TalAisenberg</dc:creator>
      <dc:date>2012-04-04T07:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Variables storage</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40759#M557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Exactly! For me, one the great things added in these recent versions of CE was the capability to use "set()" with attributes defined by us. Things get much cleaner...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&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>Wed, 04 Apr 2012 07:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/variables-storage/m-p/40759#M557</guid>
      <dc:creator>AndréCardoso</dc:creator>
      <dc:date>2012-04-04T07:42:37Z</dc:date>
    </item>
  </channel>
</rss>

