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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Build link between cad and part in Windchill through code

ptc-5376636
1-Visitor

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.

ACCEPTED SOLUTION

Accepted Solutions

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

PersistenceHelper.manager.save(link);

View solution in original post

3 REPLIES 3

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

PersistenceHelper.manager.save(link);

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);

Thanks for the quick Response.

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

Thanks.

Announcements


Top Tags