Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: How to retrive the assembly information of a part using api?

$
0
0

package geo.limited.windchill;

import wt.fc.QueryResult;
import wt.part.WTPart;
import wt.part.WTPartUsageLink;
import wt.vc.VersionControlHelper;
import wt.vc.config.LatestConfigSpec;
import wt.vc.struct.StructHelper;

 

public class RetrivingChildParts {

public void getPartStructure(WTPart parentPart) throws Exception {
     System.out.println("In getPartStructure!!"+parentPart.getNumber());
    
       

         LatestConfigSpec lcs = new LatestConfigSpec();
         QueryResult usesLinks = StructHelper.service.navigateUses(parentPart, false);
         System.out.println("usesLinks :"+usesLinks);
         while(usesLinks.hasMoreElements()){
             //FileWriter writer = new FileWriter(path, true);
             WTPartUsageLink usageLink = (WTPartUsageLink) usesLinks.nextElement();
             System.out.println(usageLink);
             WTPart childPart = (WTPart) lcs.process(VersionControlHelper.service.allVersionsOf(usageLink.getUses())).nextElement();
            
            
             getPartStructure(childPart);
         }
   

}
}


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>