Select to view content in your preferred language

Issues with Shapefile Attribute Linking in CityEngine Variables

686
3
03-09-2024 10:46 AM
richiedlon
Emerging Contributor

I've encountered an issue while attempting to link attributes of a shapefile into CityEngine variables to automatically retrieve parameter values. While this process works smoothly for some shapes, I've noticed discrepancies in certain shapes where the values of the shapefile are being altered when connected to parameters.

Has anyone else experienced similar issues? I've double-checked the attribute linking process, and everything seems to be set up correctly. However, it's puzzling why only certain attributes are affected.

Any insights or troubleshooting tips would be greatly appreciated. Thank you in advance for your assistance!Comparison of values.png

0 Kudos
3 Replies
ThomasFuchs
Esri Regular Contributor

Hello @richiedlon 

Thank you for your question. 

Looking at your screenshots, it seems like you connected the object attribute "Height of the Eave" with your rule attribute "Eave_Ht" via a layer attribute. Have you checked what the values in the Object Attributes section of the Inspector are? Maybe the difference is showing there as well? 
Inspector—ArcGIS CityEngine Resources | Documentation

0 Kudos
richiedlon
Emerging Contributor

Thank you for your reply. Strange issue is that within city engine object attributes are showing correctly as well. Only when calling the attribute as a parameter gives the incorrect value.  What I observed is that it mostly gives the value of the middle object to the main building. Refer to the attachment.

Incorrect attribute call.png

0 Kudos
ThomasFuchs
Esri Regular Contributor

Thanks for verifying this. With the connection editor, you mapped the Rule Attribute "Eave_Ht" to an Object Attribute named "EaveHeight". This created the following entry in the Layer Attributes of the "Shapes Sample" layer:

 

attr Eave_Ht = getFloatObjectAttr("EaveHeight")

 


All Object Attributes of objects in the source layer at the location are getting sampled. In your case the value of the object in the center is returned. 
The behavior is expected. 

To make a direct connection between a Rule Attribute and an Object Attribute, the names must match. Either add an extra (optionally hidden) attribute to your rule

 

@Hidden
attr EaveHeight = 50
attr Eave_Ht = EaveHeight

 

or edit the name of the object attribute

ThomasFuchs_0-1710322276007.png

Inspector—ArcGIS CityEngine Resources | Documentation

0 Kudos