cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

API for operated On type allocated parts?

kvsmanyam
4-Participant

API for operated On type allocated parts?

As per this thread:

 

Will this work for operated On type allocated parts ? 

PTC is suggesting MPMProcessPlanHelper.service.getPartsFromOperation and getOperatedPartsFromOperation and doesnt seem to work.

Please suggest.

3 REPLIES 3

Hi @kvsmanyam 

Yes it will. In my case it works pretty well. 

You just need to put an operation that have some parts linked as operated on.

Also NCServerHolder should be correctly defined. 

 

PetrH

Hi @kvsmanyam 

Following example works

NavigationCriteria navCriteria = new NavigationCriteria();
List<LatestConfigSpec> configSpecList = new ArrayList<LatestConfigSpec>();
configSpecList.add(new LatestConfigSpec());
navCriteria.setConfigSpecs(configSpecList);
NCServerHolder holder = new NCServerHolder(null, navCriteria);

Collection result = MPMProcessPlanHelper.service.getLinksForOperatedOnParts(operation, holder);

for (Object o : result)
{
ObjectReference linkObject = (ObjectReference) o;
if (linkObject.getObject() instanceof MPMOperationToOperatedPartLink)
{
MPMOperationToOperatedPartLink oplink = (MPMOperationToOperatedPartLink) linkObject.getObject();
System.out.println(oplink.toString());
}
}

 

kvsmanyam
4-Participant
(To:HelesicPetr)

I've tried this but didnt work for me. Any idea why we are passing null as first argumnent for NCServreHolder when we instantiate ? why cant we use NCServreHolder.getLatestConfigSpec() directly ?

Announcements