Skip to main content
1-Visitor
June 20, 2016
Question

API to create Link between .prt and .dwg epmdocument

  • June 20, 2016
  • 3 replies
  • 4258 views

Hi All,

Is any API to create link between .prt and it's drawing in Windchill.

i have tried EPMBuildrule type of link, but it creates structure links.

is any one has tried to create link between .prt or .asm to it's respective drawing throgh Windchill API ?

Any help will be grate.

Thanks,

Vivek

3 replies

1-Visitor
June 24, 2016

Hi Vivek,

OOTB there is no link to do this. A list of the OOTB links can be found in here.

You can create a custom Version to Version link and use this one.

The EPMBuildRule is a link between WTPart and EPMDocuments.

BR,

Tom

12-Amethyst
June 27, 2016

Dear Tom,

Just to clarify one point the hyperlink you have mentioned is a list of commonly used OOTB Links.

But apart from them there are many OOTB link exists like .

  • DeliverableActivitySubjectLink
  • EquivalenceLink

etc.

Regards,

Kaushik

12-Amethyst
June 27, 2016

EPMReferenceLink should create the link between ".asm" or ".prt" EPMDocument (3D cad model) and the respective ".drw" EPMDocument. (2D drawing).

EPMBuildRule create link between WTPart and EPMDocument while EPMMemberLink will create parent child relationship between two EPMDocument like WTPartUsageLink does in case of WTPart.

Regards,

Kaushik

1-Visitor
June 29, 2016

Dear Kaushik,

yes this link can by used, but from my point of view it isn't the correct one.

This is a Version to Master link. The correct one (from my point of view) should be a Version to Version link to by sure that you link only the referenced versions.

Eg.:

drw B.1 displays prt C.4

If you now use a Version to Master link the history of the object isn't correct.  Prt A.1 is linked to B.1 as well.

BR,

Tom 

1-Visitor
June 29, 2016
1-Visitor
June 29, 2016

Hi Vivek,

try this

EPMDocument epmDoc = <your EpmDocument>;

WTPart wtPart= <your WTPart>;

 

Folder checkOut = WorkInProgressHelper.service.getCheckoutFolder(); 

WTPart wtPartCheckOut = (WTPart) WorkInProgressHelper.service.checkout(wtPart, checkOut, "").getWorkingCopy();  //get working copy

EPMBuildRule buildRuleObj = EPMBuildRule.newEPMBuildRule(epmDoc, wtPartCheckOut, EPMBuildRule.BUILD_ATTRIBUTES); 

buildRuleObj = (EPMBuildRule)PersistenceHelper.manager.save(buildRuleObj); 

WorkInProgressHelper.service.checkin(wtPartCheckOut, "Associated Drawing Object");

1-Visitor
June 29, 2016

A D,

this work if you will link a drw and prt to the WTPart, but Vivek will link two EPMDocuments it self.

BR

Tom