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

Re: How To find all "0" Level Parts from Windchill

$
0
0

Hi All,

 

I found a new way by using partUsageLink to find the TOP level parts from asm, but the code gives some error,

Please can you help me to sort out issu.

 

Code is:

 

 

WTPart part = null;

       

QueryResult rs = WTPartHelper.service.getUsesWTPartMasters(part);

        while(rs.hasMoreElements()){

            System.out.println(""+rs.size());

            System.out.println(part.getNumber()+"----Has----Child---"+rs.size());

           

            WTPartMaster partMaster=(WTPartMaster)part.getMaster();

            QueryResult qr_parents=WTPartHelper.service.getUsedByWTParts(partMaster);

            while(qr_parents.hasMoreElements()){

                WTPart parentPart = (WTPart)qr_parents.nextElement();

                System.out.println(partMaster.getNumber()+"----Has----Parents---"+parentPart.getName());

                partMaster =(WTPartMaster)parentPart.getMaster();

               

            }

        }


Viewing all articles
Browse latest Browse all 8876

Trending Articles