Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi,
I'm looking for a API in which I want to fetch the value given on the WTPart and map with one on CAD document.
Hi @DKWc
Follwoing general examples can help you.
API to get WTPart from CAD
//EPMBuildRule.BUILD_SOURCE_ROLE
QueryResult localQueryResult = PersistenceHelper.manager.navigate(sourceEpmDocument, EPMBuildRule.BUILD_TARGET_ROLE, EPMBuildRule.class, false);
API to get parameters:
PersistableAdapter wtpObj = new PersistableAdapter(wtpart, null, null, null);
wtpObj.load("name", "number","YOURS_PARAMS");
String number = wtpObj.get("number");
String yourParam = wtpObj.get("YOURS_PARAMS");
API to save parameter:
WTCollection itemsToUpdate = new WTArrayList();
PersistableAdapter obj = new PersistableAdapter(epmDoc, null, Locale.US, new UpdateOperationIdentifier());
obj.load("YOURS_PARAMS");
obj.set("YOURS_PARAMS", yourParam);
EPMDocument epm = (EPMDocument) obj.apply();
itemsToUpdate.add(epm);
PersistenceHelper.manager.store(itemsToUpdate);
Hope it can help.
PetrH