<?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: City Engine Get Object attribute in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759717#M10021</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getObjectAttr()&lt;/SPAN&gt; does not work in cga rule files.&amp;nbsp; It is meant to only work in layer attribute code, which you can see in the Inspector when selecting a layer.&amp;nbsp; Code can be manually entered here, but it is more likely that it will be automatically entered here when connecting rule attributes to layer attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/73807"&gt;L R&lt;/A&gt;'s suggestion is a good way of getting values from an object attribute into a rule attribute with a different name.&amp;nbsp; I would go with this.&amp;nbsp; However, I want to describe another method so that I can give an example of how &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getObjectAttr&lt;/SPAN&gt; is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of doing this would be to connect your rule attribute to the object attribute through the layer.&amp;nbsp; Click on the drop down box next to your rule attribute in the Inspector and select Connect Attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/456615_connect_attribute.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, connect through a layer attribute, and select the layer and name of the object attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/456616_connect_attribute_editor.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, if you select the layer, you'll see that the Layer Attributes section in the Inspector contains the code:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;attr a = getObjectAttr("b")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getObjectAttr()&lt;/SPAN&gt; will most likely be deprecated soon to be replaced by separate functions for floats, strings, and bools.&amp;nbsp; The above automatic behavior is expected to work, but the code generated will use the new functions instead of the deprecated one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Aug 2019 14:59:52 GMT</pubDate>
    <dc:creator>CherylLau</dc:creator>
    <dc:date>2019-08-08T14:59:52Z</dc:date>
    <item>
      <title>City Engine Get Object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759714#M10018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;City Engine Get Object attribute to use as the rule default is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr streetWidth = getObjectAttr("width")&lt;/P&gt;&lt;P&gt;used to work perfectly but now in ce 2019.0 it is&amp;nbsp;telling&amp;nbsp;me that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unused function:streetWidth&lt;BR /&gt;No such function: ? getObjectAttr(a:str)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2019 14:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759714#M10018</guid>
      <dc:creator>JohnEsther2</dc:creator>
      <dc:date>2019-07-24T14:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: City Engine Get Object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759715#M10019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;attr quack &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# this is your object attribute, might want to @hidden&lt;/SPAN&gt;
attr whatgoes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; quack

@StartRule 
 Lot &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
 	 &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;whatgoes&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759715#M10019</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2021-12-12T08:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: City Engine Get Object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759716#M10020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks L R. That was helpful. this will enable me to script the attributes with python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 10:16:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759716#M10020</guid>
      <dc:creator>JohnEsther2</dc:creator>
      <dc:date>2019-08-01T10:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: City Engine Get Object attribute</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759717#M10021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getObjectAttr()&lt;/SPAN&gt; does not work in cga rule files.&amp;nbsp; It is meant to only work in layer attribute code, which you can see in the Inspector when selecting a layer.&amp;nbsp; Code can be manually entered here, but it is more likely that it will be automatically entered here when connecting rule attributes to layer attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/73807"&gt;L R&lt;/A&gt;'s suggestion is a good way of getting values from an object attribute into a rule attribute with a different name.&amp;nbsp; I would go with this.&amp;nbsp; However, I want to describe another method so that I can give an example of how &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getObjectAttr&lt;/SPAN&gt; is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of doing this would be to connect your rule attribute to the object attribute through the layer.&amp;nbsp; Click on the drop down box next to your rule attribute in the Inspector and select Connect Attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/456615_connect_attribute.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, connect through a layer attribute, and select the layer and name of the object attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/456616_connect_attribute_editor.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, if you select the layer, you'll see that the Layer Attributes section in the Inspector contains the code:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;attr a = getObjectAttr("b")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getObjectAttr()&lt;/SPAN&gt; will most likely be deprecated soon to be replaced by separate functions for floats, strings, and bools.&amp;nbsp; The above automatic behavior is expected to work, but the code generated will use the new functions instead of the deprecated one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 14:59:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/city-engine-get-object-attribute/m-p/759717#M10021</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-08-08T14:59:52Z</dc:date>
    </item>
  </channel>
</rss>

