<?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 object attribute in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/object-attribute/m-p/362255#M4971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all!&lt;/P&gt;&lt;P&gt;First time to ask questions here.&lt;/P&gt;&lt;P&gt;I am currently considering how to connect the parameters in "Object Attributes" with attributes that pre-defined in CGA rule files. I imitate the lines in "Building_From_OpenStreetMap.cga" which could use the parameter in "object attributes" in terms of "Levels".&lt;/P&gt;&lt;P&gt;Likewise, I will paste what I wrote in rule files. If anyone can make it happen without using Python, plsssss&amp;nbsp;teach me.&lt;/P&gt;&lt;P&gt;PS: two shortcuts were made manually which will be time-consuming when it comes to tremendous parameters need to be connected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr NBayNumbers = _getNBayNumbers&lt;BR /&gt;@Hidden&lt;BR /&gt;attr building__Nbay__x = -1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;@Hidden&lt;BR /&gt;attr estimatedNBayNumbers =defaultNBayNumbers&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const defaultNBayNumbers= 8&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;hasNBayNumbers = building__Nbay__x != -1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_getNBayNumbers =&lt;BR /&gt;case &lt;SPAN&gt;hasNBayNumbers&lt;/SPAN&gt; :&lt;BR /&gt;building__Nbay__x&lt;BR /&gt;else:&lt;BR /&gt;estimatedNBayNumbers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2018 16:49:45 GMT</pubDate>
    <dc:creator>ChongshenXu</dc:creator>
    <dc:date>2018-07-17T16:49:45Z</dc:date>
    <item>
      <title>object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/object-attribute/m-p/362255#M4971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all!&lt;/P&gt;&lt;P&gt;First time to ask questions here.&lt;/P&gt;&lt;P&gt;I am currently considering how to connect the parameters in "Object Attributes" with attributes that pre-defined in CGA rule files. I imitate the lines in "Building_From_OpenStreetMap.cga" which could use the parameter in "object attributes" in terms of "Levels".&lt;/P&gt;&lt;P&gt;Likewise, I will paste what I wrote in rule files. If anyone can make it happen without using Python, plsssss&amp;nbsp;teach me.&lt;/P&gt;&lt;P&gt;PS: two shortcuts were made manually which will be time-consuming when it comes to tremendous parameters need to be connected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr NBayNumbers = _getNBayNumbers&lt;BR /&gt;@Hidden&lt;BR /&gt;attr building__Nbay__x = -1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;@Hidden&lt;BR /&gt;attr estimatedNBayNumbers =defaultNBayNumbers&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const defaultNBayNumbers= 8&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;hasNBayNumbers = building__Nbay__x != -1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_getNBayNumbers =&lt;BR /&gt;case &lt;SPAN&gt;hasNBayNumbers&lt;/SPAN&gt; :&lt;BR /&gt;building__Nbay__x&lt;BR /&gt;else:&lt;BR /&gt;estimatedNBayNumbers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 16:49:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/object-attribute/m-p/362255#M4971</guid>
      <dc:creator>ChongshenXu</dc:creator>
      <dc:date>2018-07-17T16:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/object-attribute/m-p/362256#M4972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what you're asking because it seems like you've achieved what you wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you successfully connected the object attribute&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;building__Nbay__x&amp;nbsp;to the rule attribute&amp;nbsp;&lt;SPAN&gt;NBayNumbers by connecting it as a layer attribute (drop down arrow next to attr in Inspector -&amp;gt; Connect Attribute -&amp;gt; Layer attribute).&amp;nbsp; If you do it this way, you don't need all the code.&amp;nbsp; You would just need the line which creates the rule attribute NBayNumbers.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;If you would rather have rule attributes be automatically connected to object attributes (without having to go through the Connection Editor), then you need to make the rule attribute in the cga code have the same name as the object attribute.&amp;nbsp; Then, when you assign the rule file to the shape, the rule attribute will be automatically connected to object attributes with exactly the same name.&amp;nbsp; (Note that the auto connect doesn't happen if you change the code after the rule is already assigned to the shape.&amp;nbsp; Just reassign the rule in this case.)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 14:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/object-attribute/m-p/362256#M4972</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2018-07-19T14:18:49Z</dc:date>
    </item>
  </channel>
</rss>

