Getting or setting model properties via the API

Article ID: 2316
Last updated: 29 May, 2018
Article ID: 2316
Last updated: 29 May, 2018
Revision: 3
Views: 731
Posted: 22 Nov, 2006
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How do I get or set model properties via the API?

Answer

You need to get to the underlying IlvSDMModel.

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.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2316
Last updated: 29 May, 2018
Revision: 3
Views: 731
Posted: 22 Nov, 2006 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category