Skip to main content
16-Pearl
July 17, 2023
Solved

how to fetch cad structure with Each component listed once with a consolidated total quantity

  • July 17, 2023
  • 1 reply
  • 2961 views

In getStructure API,  Number of cad doc occurrences repeated because of quantity of the component in the document structure. how to fetch cad structure with Each component is only listed once with a consolidated total quantity ?

Best answer by d_graham

@AP_10343008 

I don’t think there is an alternative.

The sum is not stored in the dB. It has to be calculated.

 

Ever notice how when opening the structure tab for EPMDocs or WTParts you might see a message stating it’s working. That’s because Windchill has to calculate the structure.

You need to not only calculate the structure but you need to sum quantity EVERYWHERE the components is used in the structure.


Others can weigh in on this but I don’t see another way to get the info you’re looking for.

 

 

1 reply

18-Opal
July 17, 2023

I wrote a utility to do what you’re inquiring about.

The only way I found to do it was to write my own code that sums the quantity for each occurrence (recursively) in the assembly.

 

That will definitely work.

16-Pearl
July 18, 2023

Yeah but it takes 5 mins to check quantity of 70k documents. I need an alternative instead of calculating quantity recursively.

d_graham18-OpalAnswer
18-Opal
July 18, 2023

@AP_10343008 

I don’t think there is an alternative.

The sum is not stored in the dB. It has to be calculated.

 

Ever notice how when opening the structure tab for EPMDocs or WTParts you might see a message stating it’s working. That’s because Windchill has to calculate the structure.

You need to not only calculate the structure but you need to sum quantity EVERYWHERE the components is used in the structure.


Others can weigh in on this but I don’t see another way to get the info you’re looking for.