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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

API to create Link between .prt and .dwg epmdocument

vuchekar
9-Granite

API to create Link between .prt and .dwg epmdocument

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

9 REPLIES 9
ttempel
6-Contributor
(To:vuchekar)

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

KD
4-Participant
4-Participant
(To:ttempel)

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

KD
4-Participant
4-Participant
(To:vuchekar)

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

ttempel
6-Contributor
(To:KD)

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 

KD
4-Participant
4-Participant
(To:ttempel)

Dear Ttempel,

I don't know whether its the correct one for Vivek's requirement or not but I just describe the OOTB links and their usage in OOTB system.

As I think He just want do the same thing but programmatically.

If what you are saying is correct then can you please explain me how WTPartUsageLink works as it's also Part to PartMaster link.

Regards,

Kaushik

ttempel
6-Contributor
(To:KD)
KD
4-Participant
4-Participant
(To:ttempel)

Good information.

Thank you.

adev-2
4-Participant
(To:vuchekar)

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

ttempel
6-Contributor
(To:adev-2)

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

Top Tags