Skip to main content
1-Visitor
August 16, 2013
Solved

How To find all "0" Level Parts from Windchill

  • August 16, 2013
  • 6 replies
  • 5329 views

Hi all,

I am Exporting Multilevel BOM from Windchill by API.. it Works..

now i want to export all BOM's present in Whindchill, so first i need to be find out the "0" Level Items from Windchill.

Plese let me know how i can do this ?

How i can find the TOP_LEVEl Parts from Windchill..

Thanks,

Vivek

Best answer by KD_01

Hi,

In this line QueryResult rs = WTPartHelper.service.getUsesWTPartMasters(part); you are passing the part variable value as null which is leading to error.

Thanks and Regards,

Kaushik

6 replies

12-Amethyst
August 16, 2013

Hi Vivek,

you can use queryspec to querying the database to get all the end items

GregoryPERASSO
16-Pearl
August 19, 2013

If you use "End Item" to track top level assemblies , you can query the DB as Kaushik said.

if not , you have to query all WTPartsMasters, where the oid (ida2a2) does not exist is the WTPartUsageLink table (ida3b5). ie WTpart that are not used as child in a BOM.

You can do that query by API

vuchekar1-VisitorAuthor
1-Visitor
September 2, 2013

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();

}

}

KD_0112-AmethystAnswer
12-Amethyst
September 4, 2013

Hi,

In this line QueryResult rs = WTPartHelper.service.getUsesWTPartMasters(part); you are passing the part variable value as null which is leading to error.

Thanks and Regards,

Kaushik