My team is working on building the footprints for a college campus and had a few questions regarding using a coding source to create rules for our data in CityEngine. We figured out how to extrude each building at it's "mean" height from our GIS data and we have over 100 buildings in which we created a rule attribute (Rule2_face) in ArcGIS Pro but need help incorporating the attribute with each building in a script form. We found a few examples we can refer but not quite helpful for the beginner stage.
extrude at mean height:
First, export your shapes from Pro so that when they are imported into CityEngine, the shapes have object attributes for the data shown in your table.
Then, you can create a rule attribute called Rule2_face similar to how you created one for buildhei_5.
attr rule2_face = 0
Since the rule attribute has the same name, it will automatically connect to the object attribute with the same name when you assign the rule file to the shape. You can also manually connect the rule attribute to the object attribute by clicking on the drop down arrow next to the attribute in the Inspector and selecting Connect Attribute. The rule attribute has to have the same name as the object attribute.