Hello!
I'd like to change an attribute of a leaf shape (flag the attribute "window" as "yes" for window shapes).
I tried creating an object attribute (str, NULL or "no") and then filling it in with this, but without success:
Window -->
s('1,'1,0.4)
t(0,0,-0.25)
i(window_asset)
set(window, "yes")
Maybe set() is the wrong function. What would be a better way?
After that I thought of using a Python script and try to select all the leaf shapes that are windows. Can you actually select just certain leaf shapes with ce.selection? How would I do that?
Cheers
Solved! Go to Solution.
The print command goes in the CGA. You can see the printout when you generate the model, under CGA Console. If you export to GDB you have to report your attributes. It'll write a bunch (average, etc) you most likely won't need but you can delete them again. Here's a simple example:
@StartRule
Lot -->
extrude(10)
split(x){~0.5: A | ~0.5: B}
A -->
set(Window, "yes")
print(Window)
report("Window", Window)
B -->
set(Window, "nope")
print(Window)
report("Window", Window)
Set is correct. It changes, but it won't be reflected in the Inspector. Use Inspect model under Model Hierachy (but the actual info tab is under Inspector...) and you'll see. Alternatively, print(window).
Thanks for your answer!
However, when I export the buildings as multipatch features (with one feature per leaf shape), the attribute change is not visible in the attribute table in ArcGIS. So that's why I'm not sure, if the attribute is even changed. The better question is maybe, why I can't see the attributes in Arcmap?
Where can I use the command print(window)?
City Engine Help .... might be what you are looking for, for general guidance.
I did use the CityEngine help. But I did not find any details on how to make sure that all the attributes of a leaf shape are exported (other than ticking Export object attributes).
Can you point me in the right direction?
I was referring to links to the 'console' to print stuff
Ah, I see. Thank you!
The print command goes in the CGA. You can see the printout when you generate the model, under CGA Console. If you export to GDB you have to report your attributes. It'll write a bunch (average, etc) you most likely won't need but you can delete them again. Here's a simple example:
@StartRule
Lot -->
extrude(10)
split(x){~0.5: A | ~0.5: B}
A -->
set(Window, "yes")
print(Window)
report("Window", Window)
B -->
set(Window, "nope")
print(Window)
report("Window", Window)
It worked. Thank you very much!