How to dynamically vary properties of a load object?
Options
![Ayush Kumar](https://us.v-cdn.net/6037473/uploads/userpics/RGJ3E8O4WFAG/n98CYBYJ7H6ZS.jpg)
Ayush Kumar
Member, Moderator, Employee Posts: 419
![Ansys Employee](https://us.v-cdn.net/6037473/uploads/badges/RVRDV39KPJ91.png)
![Solution Developer Community of Practice Member](https://us.v-cdn.net/6037473/uploads/badges/274G8C56SBE6.png)
Answers
-
The XML can be defined only static with all the possible properties defined.
<onvalidate>
callback of a property can be used to hide/show other load object properties using Python.Eg:
<property name="SelectStatic" caption="Select (static)" control="select"> <attributes options="Option 1,Option 2,Option 3" /> <callbacks> <onvalidate>hide_other_properties</onvalidate> </callbacks> </property>
def hide_other_properties(load, property): if property.Value == "Option 1": load.Properties["SelectDynamic"].Visible = False else: load.Properties["SelectDynamic"].Visible = True ExtAPI.DataModel.Tree.Refresh()
0