Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello everyone,
I have developed this code that find all the WtPart refrenced by a drawing (.drw).
It's works fine on a stand alone Java application , but when I try to do the same on a POST_CHECKIN Listener the code is unable to find the referenced objects.
Is it matter of the calculation link ?
Thank you !
public static WTPart wtpRetrieveDrawingAssociatedWtPart(EPMDocument epm) throws Exception {
WTPart wtPart = null;
CADAssociatedParts relationship = new CADAssociatedParts();
relationship.setTypes(CADAssociatedParts.Type.CALCULATED_BUILD);
List<Object[]> epmDocs = EPMNavigateHelper.navigate(epm, relationship, CollectItem.SEED_ID, CollectItem.OTHERSIDE).getRawResults();
if(epmDocs != null) {
for(Object[] objects : epmDocs) {
for(Object o : objects) {
if(o instanceof WTPart) {
WTPart tempPart = (WTPart) o;
System.out.println("StandardListenService: " + epm.getName() + " WtPart referenced by" + tempPart.getName() + " " + tempPart.getNumber() );
if(tempPart.isLatestIteration()) {
if (tempPart.getName().toLowerCase().contains(".asm")) {
wtPart = tempPart;
break;
}
}
}
}
}
}
return wtPart;
}
Solved! Go to Solution.
Hi ShirishMorkhade,
I'm sorry for the delay in answer to your suggestion.
Anyway the POST_STORE work fine, so now i'm able to reload all calculated links
Thank you very much
Giorgio
Hi Giorgio,
I am facing the same issue.
I am trying to get the Reference EPMDocuments while checkin the Drawing using the POST_STORE event.
Can I know which API you are using?
Thanks,
Hemanth Kumar