Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Version: Windchill 13.0
Use Case: I’m trying to assign an Option Set to a Configurable Part. Can anyone help me with the API code for this?
Description:
I’m trying to assign an Option Set to a Configurable Part. Can anyone help me with the API code for this?
It looks like there is some info on getting the assignment info: https://www.ptc.com/en/support/article/CS406283?source=search
But setting it might not be supported: https://www.ptc.com/en/support/article/CS413254?source=search
Hi @AKC,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
Anurag
Hi @AKC
It is just idea how to do so but it could work.
here is an example how the link could be created but it needs good testing if it is the right way
OptionSetMemberLink optionSetLink = new OptionSetMemberLink();
optionSetLink.setRoleAObject(); //input OptionSet.class
optionSetLink.setRoleBObject(); //input ChoiceMaster.class
wt.fc.PersistenceServerHelper.manager.insert(optionSetLink);//store in DB
ChoiceMappableChoiceLink choiceLink = new ChoiceMappableChoiceLink();
choiceLink.setRoleAObject(); //input ChoiceMappable.class which is WTPart, EPMDocument all objects in the system where the choices can be set
choiceLink.setRoleObject(); //input ChoiceMaster.class
wt.fc.PersistenceServerHelper.manager.insert(choiceLink);// store in DB
PetrH