<?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: Attributes rule in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548435#M7406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Lukasz,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have a file GDB from which you are importing attributed shapes, you will want to use CGA rules (Python not needed here) to read those attributes and use the attribute data to help create the generated model. To do this, first create an attribute in your CGA rule, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr MatchingNameGoesHere = 42&amp;nbsp; # (default value)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The CGA attribute name must match exactly (case sensitive) the attribute in the GDB. Next, apply this rule to the shapes in question. Upon applying this rule, CE will see the matching names and then connect the CGA attribute in the Inspector to the Object Attribute coming from the GDB. If it does not occur automatically, or if the rule was previously applied to this shape, you can manually make this connection by clicking the Attribute Connection Editor next to the attribute value in the inspector. This will only work of the names match. If you need for the names to not match, then you can get the same effect using the Layer Attributes option inside the Attribute Connection Editor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this work for you?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 18:52:19 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-05-28T18:52:19Z</dc:date>
    <item>
      <title>Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548434#M7405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matthias,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Quick question, we use the gdb file with attributes already inside each room,&amp;nbsp; for instance, one floor has lower walls the other upper - in attributes, so we would like to create a new rule that would extrude lower walls 2feet and upper 4 feet, how do we use python to make the program read from the attributes that are already in gdb ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;?ukasz&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 17:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548434#M7405</guid>
      <dc:creator>LukeCzar</dc:creator>
      <dc:date>2013-05-28T17:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548435#M7406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Lukasz,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have a file GDB from which you are importing attributed shapes, you will want to use CGA rules (Python not needed here) to read those attributes and use the attribute data to help create the generated model. To do this, first create an attribute in your CGA rule, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr MatchingNameGoesHere = 42&amp;nbsp; # (default value)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The CGA attribute name must match exactly (case sensitive) the attribute in the GDB. Next, apply this rule to the shapes in question. Upon applying this rule, CE will see the matching names and then connect the CGA attribute in the Inspector to the Object Attribute coming from the GDB. If it does not occur automatically, or if the rule was previously applied to this shape, you can manually make this connection by clicking the Attribute Connection Editor next to the attribute value in the inspector. This will only work of the names match. If you need for the names to not match, then you can get the same effect using the Layer Attributes option inside the Attribute Connection Editor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this work for you?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:52:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548435#M7406</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-05-28T18:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548436#M7407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lukasz&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 13:27:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548436#M7407</guid>
      <dc:creator>LukeCzar</dc:creator>
      <dc:date>2013-06-27T13:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548437#M7408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have building footprints with the attribute "height", but I want to use these height values with my Rule attribute "BuildingHeight". I mean I dont want to use my object attribute name as rule attribute name. How can I use object attribute values without using the same name?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 13:07:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548437#M7408</guid>
      <dc:creator>gulhunduran</dc:creator>
      <dc:date>2013-07-09T13:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548438#M7409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;by mapping the value ..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr height = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;attr buildingHeight = height&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 14:09:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548438#M7409</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-07-09T14:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548439#M7410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After doing so, value was still zero. Then, to map the values I opened the Attribute Connection Editor dialog but it says there is no object attribute named "BuildingHeight". What am I supposed to do now?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 04:54:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548439#M7410</guid>
      <dc:creator>gulhunduran</dc:creator>
      <dc:date>2013-07-10T04:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548440#M7411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;play around a bit with the values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; break down each step you need:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;maybe to start, just print() all the values which come from the footprints. once you have your values of interest, just redirect the value to your attr. I see you're using the Connection Editor, so you're on a good way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It must be something very small, so check each step you wrote in code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope you figure this out ..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 07:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548440#M7411</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-07-10T07:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548441#M7412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually, I'm not familiar with coding. That's why my code is very simple:) Can you please tell me what is wrong with this rule:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr height = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;attr buildingHeight = height&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lot--&amp;gt;extrude(world.y, buildingHeight)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much for your help:)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 09:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548441#M7412</guid>
      <dc:creator>gulhunduran</dc:creator>
      <dc:date>2013-07-10T09:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548442#M7413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code will use the value 0 for the extrusion unless you can point the attr height to an imported attribute which has a realistic value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd recommend you watch the &lt;/SPAN&gt;&lt;STRONG&gt;tutorial videos 1 -6&lt;/STRONG&gt;&lt;SPAN&gt; before diving into writing code beforehand. This stuff will be covered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Find them here :&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/64843-CityEngine-Collection-RESOURCES-FAQ-HELP"&gt;http://forums.arcgis.com/threads/64843-CityEngine-Collection-RESOURCES-FAQ-HELP&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will help you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 08:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548442#M7413</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-07-11T08:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548443#M7414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It worked perfectly! Thanks for your support!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 11:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548443#M7414</guid>
      <dc:creator>gulhunduran</dc:creator>
      <dc:date>2013-07-11T11:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548444#M7415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matthias,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this thread finds you well,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm relatively new to CE and CGA Rules and was wondering what my rule should be to let the program know to extrude not a fixed number but the number in the attribute.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e --&amp;gt; Buildings with floors. Some buildings have 10, some have 3. I want to apply 1 rule to the whole map and have the correct height for each building.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 15:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548444#M7415</guid>
      <dc:creator>MarcoPesci</dc:creator>
      <dc:date>2013-07-25T15:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes rule</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548445#M7416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know the heights of the building, or the number of floors of the building?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's heights you'd want something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; attr height = 0&amp;nbsp; #this looks at the height attribute in your building parcel (note the same should be &lt;I&gt;exactly&lt;I&gt; the same as that in the object attributes
attr floor_height = 3.8 #value here should be the height each floor is

Lot--&amp;gt;extrude(height) Building

Building--&amp;gt;comp(f){side : Facade | top : Roof}
Facade--&amp;gt;split(y){{floor_height : Floor }*| ~1 : Wall} # what this does is split the building up so that based on the building height it creates the floors 
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have the number of floors it's similar to the heights but:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr number_floor = 0 #again same name as what's in your object attribute
attr floor_height = 3.8 #use what ever average floor height you want here
attr building_height = number_floor*floor_height #this determines the building height based on the other factors

Lot--&amp;gt; extrude(building_height)
etc.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope that helps &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>Sat, 11 Dec 2021 23:43:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/attributes-rule/m-p/548445#M7416</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2021-12-11T23:43:35Z</dc:date>
    </item>
  </channel>
</rss>

