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

Build link between cad and part in Windchill through code

SOLVED
Highlighted
Level 1

Build link between cad and part in Windchill through code

I have loaded the cad file first in Windchill and the associated part later.So cad part and the part do not have link.

I need to create the link for each epm document.This can be done manually using "Edit Association" for each EPM Document by opening in Windchill .

I need this to be done through java code.

Anyone can give a method how to build the link through code?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Build link between cad and part in Windchill through code

EPMDescribeLink link = EPMDescribeLink.newEPMDescribeLink(wtPart, epmDocument);

PersistenceHelper.manager.save(link);

3 REPLIES 3

Re: Build link between cad and part in Windchill through code

EPMDescribeLink link = EPMDescribeLink.newEPMDescribeLink(wtPart, epmDocument);

PersistenceHelper.manager.save(link);

Re: Build link between cad and part in Windchill through code

Use code below to connect Cad and Part with Owner Link (Pass 4 in parameter for creating Image build type)

ReferenceFactory factory=

new ReferenceFactory();

WTPart wtpart = (WTPart)factory.getReference(

"<WT Part Obid>").getObject();

EPMDocument doc=(EPMDocument)factory.getReference(

"<cad Doc Obid>").getObject();

EPMBuildRuleAssociationLink link = EPMBuildRuleAssociationLink.newEPMBuildRuleAssociationLink(doc, wtpart, 0, 4);

PersistenceHelper.

manager.store(link);

Re: Build link between cad and part in Windchill through code

Thanks for the quick Response.

Cad to part link got built after using the above methods.

Thanks.