How to read rule-based attributes of an object?

1307
2
08-02-2016 09:39 PM
MohsenNazemi
New Contributor II

I am using the open source "complete street" rule file. I have defined and modified some street attributes such as speed. How can I read the speed of each street from the generated model, via Python API?

Tags (1)
0 Kudos
2 Replies
LR
by
Occasional Contributor III

Can't test ATM, but this should work on a selected shape:

ce.getAttribute(ce.selection()[0], '/ce/rule/myAttribute')

0 Kudos
ThomasFuchs
Esri Regular Contributor

Hello Mohsen Nazemi,

This is a quite common question. It is not possible to directly read out the rule-defined attributes.
Please also refer the following GeoNet thread:

Is it possible to read rule-defined attributes with Python?

However there are indirect methods, like exporting a report to get the values.

Tutorial 12: Scripted report export—CityEngine Tutorials | ArcGIS for Desktop

0 Kudos