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

WTPart-EPMDocument associations

SOLVED

WTPart-EPMDocument associations

Hi.

How can i operate by java code with associations between WTPart and CAD document? How can i distinguish Owner, Contributing Image, Image, Contributing Content and Content assocations?

What classes these associations are presented by? Are they differ by some attribute?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: WTPart-EPMDocument associations

Hello,

Owner, Contributing Image, Image, Contributing Content are the same link (dual link EPMBuildRule & EPMBuildHistory - may be 3 links since 10.0 ). just an attribute "BUILD_TYPE" to distinguish the type of link. Used mainly for 3D model

and Content link is the epmdescribelink. Used mainly for CAD drawings

regards

View solution in original post

6 REPLIES 6

Re: WTPart-EPMDocument associations

Hello,

Owner, Contributing Image, Image, Contributing Content are the same link (dual link EPMBuildRule & EPMBuildHistory - may be 3 links since 10.0 ). just an attribute "BUILD_TYPE" to distinguish the type of link. Used mainly for 3D model

and Content link is the epmdescribelink. Used mainly for CAD drawings

regards

View solution in original post

Re: WTPart-EPMDocument associations

Gregory,

can you say something about "Calculated" association?

Re: WTPart-EPMDocument associations

Calculated associations are not "real links" persited in database between WTpart and EPMdoc

They are calculated: from the WTpart, through the owner link to the 3D CADdoc, then to all Drawings that are linked by reference to this 3D model. But with a filter based on "As stored configspec"

I do not use this calculated links, and made some enhancement request to PTC to hide them (or overload them if both a calculated or a real content link exists). As depending of user scenario, (notably when revising / modifying Drawing alone), it changes the calculated link without any iteration or revision at the WTpart level . which is a non sense when using windchill with a part centric approach.

Highlighted

Re: WTPart-EPMDocument associations

Do you know how get EPMDocument from WTPart by java code if they are linked with "Calculated" association?

Re: WTPart-EPMDocument associations

Have a look to EPMNavigateHelper.navigate .

But not sure if supported ... ask to PTC TSupport for the best API

Re: WTPart-EPMDocument associations

Next code works fine:

List<EPMDocument> documents = new ArrayList<EPMDocument>();

AssociatedCADDocs relationship = new AssociatedCADDocs();

relationship.setTypes(AssociatedCADDocs.Type.IMPLICIT);

List<Object[]> epmDocs = EPMNavigateHelper.navigate(wtPart, relationship, CollectItem.SEED_ID, CollectItem.OTHERSIDE).getRawResults();

if(epmDocs != null)

{

for(Object[] objects : epmDocs)

{

for(Object o : objects)

{

if(o instanceof EPMDocument)

{

documents.add((EPMDocument) o);

}

}

}

}

And in other direction (not checked):

WTPart wtPart = null;

CADAssociatedParts relationship = new CADAssociatedParts();

relationship.setTypes(CADAssociatedParts.Type.IMPLICIT);

List<Object[]> epmDocs = EPMNavigateHelper.navigate(epmDocument, 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;

if(tempPart.isLatestIteration())

{

wtPart = tempPart;

break;

}

}

}

}

}

Announcements
LiveWorx Call For Papers Happening Now!