cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

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

abasRyan
10-Marble

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

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.

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5

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

 

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

Thnaks!

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

I can get a session ID in the playground, but get the error "Unable to connect to Creo through J-Link" when giving it a file location.
Does that mean Jlink isnt installed? I am pointed to C:\Program Files\PTC\Creo 6.0.3.0\Common Files
But I do not see a jlink directory. When I installed creo I selected this option:
"Creo object TOOLKIT Java and Jlink"

 

 


@abasRyan wrote:

I can get a session ID in the playground, but get the error "Unable to connect to Creo through J-Link" when giving it a file location.


That does not make sense.... If you can get a sessionID in the playground... you can talk through J-LINK.   So that is good!

 

Can you expand on your "giving it a file location"???  Are you trying to do something outside of the playground?  Did you do a "connection : connect" request first to get a new SessionID before making subrequests (e.g. bom: get_paths).

 

Dave

Announcements


Top Tags