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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to find all the CAD Documents attached to a WTPart using different types of link?

vkarunakaran
2-Explorer

How to find all the CAD Documents attached to a WTPart using different types of link?

Hi,

I want to know how to find CAD Documents linked to WTParts using different types of link using API's.

4 REPLIES 4

Vipin Karunakaran wrote:

Hi,

I want to know how to find CAD Documents linked to WTParts using different types of link using API's.

The java api is this:

WTPartHelper.service.getDescribedByDocuments(WTPart part);

You can search this web site for some previous posts on this.

Hi ,

I wanted to find the CAD document linked with owner link or calculated link. I am not able to retrieve using the above API for a WTPart

I am not sure if the "getDescribedByDocuments" will return the same results as the "Related CAD Documents" table, do you know this guys?

Hello Vipin,

Nice to see you here. You may try as below, I just write manually here not 100% sure but you can test with your scenario.

public static ArrayList<EPMDocument> getOwnerEPMDocs (WTPart part) throws WTException{

     ArrayList<EPMDocument> ownerList = new ArrayList<EPMDocument>();

     if(part == null) return null;

     QueryResult qr = WTPartHelper.service.getDescribedByDocuments(part);

     while (qr.hasMoreElements()){

          WTObject objLink = (WTObject)qr.nextElement();

          if (objLink instanceof EPMBuildRule){

               EPMBuildRule buildLink = (EPMBuildRule) obLjLink;

               if(buildLink.getBuildType()==7){

                    ownerList.add((EPMDocument)buildLink.getRoleAObject());

               }

          }

     }

}

BTW, calculate link is not Persistable link in Windchill, I don't know whether we can get it by API.

Regards

Kevin

Announcements

Top Tags