Change object attribute of a leaf shape?

451
8
Jump to solution
05-14-2018 10:31 PM
nataliebrandenberg
New Contributor

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

0 Kudos
1 Solution

Accepted Solutions
LR
by
Regular Contributor

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)

View solution in original post

8 Replies
LR
by
Regular Contributor

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).

0 Kudos
nataliebrandenberg
New Contributor

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)?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

City Engine Help ....  might be what you are looking for, for general guidance.

0 Kudos
nataliebrandenberg
New Contributor

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?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

I was referring to links to the 'console' to print stuff

0 Kudos
nataliebrandenberg
New Contributor

Ah, I see. Thank you!

0 Kudos
LR
by
Regular Contributor

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)
nataliebrandenberg
New Contributor

It worked. Thank you very much!

0 Kudos