Skip to main content
1-Visitor
February 3, 2020
Solved

How do I get a BOM / component list in java?

  • February 3, 2020
  • 1 reply
  • 2872 views

Hello, I'm trying to access the BOM or component list of an assembly so that I can use it in an import tool for another program. 

I see in the otkjavaexamples a ListDisplayedComponents method that returns a list of parts, but I would also need the quantity. Also, this method seems to drill into the BOM structure. I just need the top level assembly parts and their quantities.

I can't seem to find the correct methods or classes to achieve this.

Best answer by DavidBigelow

Well... there you go ... I love it when a long term plan comes together.. 🙂

 

Good Luck - I think you will find CREOSON pretty neat beyond the BOM data.

 

Dave

1 reply

17-Peridot
February 3, 2020

This requires quite a few steps to get via Java.... we optimized this in CREOSON (open source automation for Creo) to make it easier...  You can call it (amongst other functions ) from Java (or any other language) using JSON transactions via HTTP requests.

 

Look at the help doc for "bom : get_paths  top_level = true" 

 

The JSON response from that you can then process for the quantities with a simple loop.

 

Alternatively, if you are looking for a more simple tool/way to get data into Excel for comparing/passing to another system.. Nitro-BOM works really well... (note we sell that)

 

Hope that helps.

 

Dave

 

abasRyan1-VisitorAuthor
1-Visitor
February 3, 2020

I'll give this a read. 
I need to upload the parts to another program via JSON and REST anyway.

Thnaks!

17-Peridot
February 3, 2020

Well... there you go ... I love it when a long term plan comes together.. 🙂

 

Good Luck - I think you will find CREOSON pretty neat beyond the BOM data.

 

Dave