Skip to main content
10-Marble
June 13, 2023
Question

How to get the WTDocument from WTPart through customization ?

  • June 13, 2023
  • 2 replies
  • 967 views

 

2 replies

Fadel
23-Emerald I
June 13, 2023

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
Buiꓘa
joe_morton
18-Opal
18-Opal
June 27, 2023

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