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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to get the WTDocument from WTPart through customization ?

CH_10067600
10-Marble

How to get the WTDocument from WTPart through customization ?

 

2 REPLIES 2
Fadel
22-Sapphire I
(To:CH_10067600)

Hi , 

  • Described By Documents
 
QueryResult qr = PersistenceHelper.manager.navigate(part,WTPartDescribeLink.DESCRIBED_BY_ROLE, wt.part.WTPartDescribeLink.class,false);
 
while (qr.hasMoreElements()){
WTPartDescribeLink link = (WTPartDescribeLink)qr.nextElement();
System.out.println("Found link ..........." + link);
WTDocument doc = link.getDescribedBy();
System.out.println("Described By Document ...."+ doc.getNumber());
}
 
  • References Documents
QueryResult qr = PersistenceHelper.manager.navigate(part,WTPartReferenceLink.REFERENCES_ROLE, wt.part.WTPartReferenceLink.class,false);
 
while (qr.hasMoreElements()){
WTPartReferenceLink link = (WTPartReferenceLink)qr.nextElement();
System.out.println("Found link ..........." + link);
WTDocumentMaster doc = link.getReferences();
System.out.println("Referenced By Document ...."+ doc.getNumber());
}
 
 
BR,
Fadel
Fede

Some additional reference is available here: https://www.ptc.com/en/support/article/CS385644

 

Announcements

Top Tags