Select to view content in your preferred language

When set operation is used - update inspector

784
4
01-05-2022 02:04 PM
Clover4
Emerging Contributor

When the set operation is used in the CGA the inspector attributes do not update to show the change.   Could this be fixed?

0 Kudos
4 Replies
JonasObertuefer
Esri Contributor

Hi Brian,

This can't be fixed because thats not how the inspector works:

The inspector shows the attributes how they are set in the rule or set by the user before the actual generate happens.

The set operation does set the attribute dynamically while generating the rule and it will also set the attribute for the current shape tree (and all it's childs) only, it's the same behaviour as with builtin attributes e.g. set(material.opacity,..)

Hope this clarifies things a bit.

What do you want to achieve? Maybe there is another way to do it?

Cheers,
Jonas

0 Kudos
Clover4
Emerging Contributor

Thanks Jonas!   This is helpful.   I've been trying to figure out the best way to do styles.  I think the best way currently is to set up csv sheets with style attributes.  Unlike set operation, they can be over-ridden. Having a csv style sheet can give a useful starting point for a particular style in a complex code with lots of attributes. 

But I think it would be nice if there was a way to automate the styles created in the inspector which get pasted into the code at the end, instead into csv sheets/arrays the way that the new materials export works.  To note, there is already an "idea" for this by someone for something like this.   The material get/set method was a great improvement!  I think the difference is in workflows - setting styles in the inspector at the end seems intuitive, but creating a csv style sheet before or after working on your code is less so.   

These are just thoughts open to change through discussion and understanding!

0 Kudos
JonasObertuefer
Esri Contributor

I see, thanks for the input. Just one more question for understanding: Why is directly managing it via styles in the cga not an option?

Partially you can achieve this via python scripting:

  • Set up a CSV with all your attributes
  • Iterate through the CSV file and set attributes via ce.setAttribute()
  • Get all user set attributes: ce.getAttributeList()*
  • Write a new CSV with all your attributes

https://doc.arcgis.com/en/cityengine/latest/python/python-parameters-and-attributes.htm

 

* This will list you the user set cga attributes only, not all cga attributes.

0 Kudos
CherylLau
Esri Regular Contributor

What Jonas says is correct.  There also is another way to use csv files without python.  You could store your attribute settings in the csv file.  Then, in cga code, you could read the csv file using readStringTable() and set rule attributes according to what's in the csv file.

0 Kudos