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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. 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
HelesicPetr
22-Sapphire I
(To:kvsmanyam)

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

HelesicPetr
22-Sapphire I
(To:kvsmanyam)

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

Top Tags