<?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 it possible to read rule-defined attributes with Python? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209940#M2764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;python script which includes loops". There is not a "loop" in CGA, but you can do recursion for most things that a loop would be needed for. I can show you how recursion works. Can you tell more about the calculation involving area?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jan 2015 15:40:53 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2015-01-05T15:40:53Z</dc:date>
    <item>
      <title>Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209935#M2759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writting a script in which i would like for python to read rule defined attributes such as area from CGA geometry.area.&lt;/P&gt;&lt;P&gt;I know is possible to read user-defined attributes, but when its rule defined, it doesnt seem to work.. Alternativly, is there an option to provide areas in the Object attributes of the shape, which dynamically changes as the object changes? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in Advance, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jan 2015 21:24:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209935#M2759</guid>
      <dc:creator>floraroumpani</dc:creator>
      <dc:date>2015-01-04T21:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209936#M2760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Flora !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both things are not possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1]&lt;/P&gt;&lt;P&gt;the CGA rule values that you see in the Inspector when the rule is evaluated can not be queried. You need to report it and fetch the value with Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2]&lt;/P&gt;&lt;P&gt;there's no dynamic way of defining object attributes. You also need Python to update those values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you handle this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN-US"&gt;Matthias Buehler&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN lang="EN-US"&gt;Head of 3D Technologies&lt;/SPAN&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999; font-size: 10pt;"&gt;&lt;SPAN lang="EN-US"&gt;twitter: @MattB3D&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Garsdale Design Limited &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:matthias.buehler@garsdaledesign.co.uk" target="_blank"&gt;matthias.buehler@garsdaledesign.co.uk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.garsdaledesign.co.uk/" target="_blank"&gt;www.garsdaledesign.co.uk&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 10:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209936#M2760</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2015-01-05T10:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209937#M2761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was afraid of that.. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp; I ll try the first option and see what i can do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 12:14:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209937#M2761</guid>
      <dc:creator>floraroumpani</dc:creator>
      <dc:date>2015-01-05T12:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209938#M2762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flora, can you explain your goal? (just to see if another route might exist).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 14:44:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209938#M2762</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-01-05T14:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209939#M2763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chris, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply. What I practically need to do is to include area calculation in my python script which includes loops. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks , &lt;/P&gt;&lt;P&gt;F. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 15:35:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209939#M2763</guid>
      <dc:creator>floraroumpani</dc:creator>
      <dc:date>2015-01-05T15:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209940#M2764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;python script which includes loops". There is not a "loop" in CGA, but you can do recursion for most things that a loop would be needed for. I can show you how recursion works. Can you tell more about the calculation involving area?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 15:40:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209940#M2764</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-01-05T15:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209941#M2765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/35348"&gt;Chris Wilkins&lt;/A&gt;​, &lt;/P&gt;&lt;P&gt;Sorry for the delayed reply.&amp;nbsp; I am not sure how to do certain recursive functions within CGA. For example is it possible to find the minimum-maximum of an attribute for a list of shapes? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 11:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209941#M2765</guid>
      <dc:creator>floraroumpani</dc:creator>
      <dc:date>2015-05-15T11:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209942#M2766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For lists of shapes you must use Python, since CGA only handles one shape at a time, and they can't talk to each other. Rather than learning Python, there is a quick and easy, yet manual way to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your rule, print the value of your attribute to the console, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print(someAttributeValueYouMustPutHere) &lt;/P&gt;&lt;P&gt;# Put this somewhere like the beginning so it only prints once per shape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save the rule, show the console window and then clear its contents, then select all shapes at once, and run that rule. All of the attribute values will be in the console. In the console, select all (control-A), copy(control-C), open an Excel spreadsheet, and paste the values in. You can see the max and min values at the bottom of the screen when the values are all selected. Then plug those values back into whereever you needed it. I'm assuming some sort of colorRamp or something that needs min and max for normalization?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 23:01:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209942#M2766</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-05-15T23:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to read rule-defined attributes with Python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209943#M2767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/35348"&gt;Chris Wilkins&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was looking for something dynamic, but i guess its not possible. Can i suggest this for future CE versions?? A min max function built in CGA would be very useful i think.:) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best wishes,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 15:57:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-read-rule-defined-attributes/m-p/209943#M2767</guid>
      <dc:creator>floraroumpani</dc:creator>
      <dc:date>2015-06-01T15:57:46Z</dc:date>
    </item>
  </channel>
</rss>

