|| | |||Browse by category|
How do I get or set model properties via the API?
You need to get to the underlying
IlvDiagrammer diag = ...
IlvSDMEngine engine = diag.getEngine();
IlvSDMModel model = engine.getModel();
Object dataObj = engine.getObject(...);
String propertyName = ...;
Object value = model.getObjectProperty(dataObj, propertyName);
As long as you can retrieve the object and have the property name, you can get at its value, then cast it to its appropriate type.
There is also a corresponding method
IlvSDMModel.setObjectProperty(Object, String, Object)
to update the object.