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

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

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.

Tags (1)
4 REPLIES 4

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

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.

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

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

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

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

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

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
LiveWorx Call For Papers Happening Now!