Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BOM Scripting Issues

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
554 Views, 3 Replies

BOM Scripting Issues

Hello,

 

I have encountered a couple of different problems through BOM scripting that I am looking for help with.

 

  1. I am having trouble with the addBOM command and custom fields. Following scripting examples, I have tried both of the following:
  • item.boms.addBOM({RELATED: part.item,QUANTITY: 1,CUSTOM_FIELDS: {SO_LINE_ITEM_NUMBER:120},ITEM_NUMBER: 1,QUOTE: part.quote});
  • item.boms.addBOM(part.item,1,{SO_LINE_ITEM_NUMBER:120},2,part.quote);

In both cases, the item is added to the BOM, but the field SO Line Item Number is blank (It is a single line text field). I'm not sure what I am doing wrong here.

 

2.  I have found that quote IDs using item.boms[i].quote.id and by using item.boms[i].item.sourcing[i].quote[i].id do not always match up. For instance:

 

I have an item that has one source with two quotes attached to that source. Through testing I have found the following:

 

  • item.boms[0].quote.id                                   Produces 4180
  • item.boms[0].item.sourcing[0].quote[0].id     Produces 4172
  • item.boms[0].item.sourcing[0].quote[1].id     Produces 4173

The quote ID from the BOM does not match any of the quote IDs from the item's sourcing tab, though the other properties match that of the sourcing quote with the ID 4172. Is there a reason behind this. I need these to match as I am creating a script to run through items in a BOM and determine the supplier of each item.

 

Any help would be greatly appreciated!!

 

Matt

Tags (3)
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

After more testing, I have found the problem with the quote IDs not matching. It has to do with the revision of an item and the default quote. When an item is added to a BOM, if a quote is not selected and the default quote is used, item.boms[i].quote.id is linked to the working revision of the item and not the revision of the item that is listed on the BOM. However, item.boms[i].item.sourcing[i].quote[i].id is linked to the revision of the item that is listed in the BOM. This is the reason that the quote IDs are not matching up, which is a problem.

 

With that being said, is there any way to make the default quote in the BOM be linked to the revision of the item that is listed in the BOM instead of the working revision?

 

I am still searching for an answer to adding custom fields with addBOM.

 

Thanks for any help!

 

Matt

Message 3 of 4
gasevsm
in reply to: Anonymous

Hi Matt,

 

We are evaluating the quotes matter. May we contact you direct in case we have additional questions or need to understand intent?

 

>> I am still searching for an answer to adding custom fields with addBOM.

We've identified this is a defect and are investigating root cause. Can you confirm that SO_LINE_ITEM_NUMBER is NOT read-only field?  In the meantime, consider updating custom fields after calling addBOM call.

 

Regards,


Martin Gasevski | Fusion 360 Team Product Manager
Message 4 of 4
j.hendrickson
in reply to: gasevsm

Sorry to dig up an old thread but it seems related to problems we are having now.

 

We are trying to create BOM lines via scripting, including populating a couple of custom fields at the same time.  We couldn't get this to work by including the values in the initial addBOM call and based on Martin's comment from 2014 we have also tried to set the custom field values in separate lines afterwards, but it is still not working.

 

It's almost like newly created BOM lines are not immediately available to a scripting session.  The same code will write to existing BOM lines if run in a separate script so it sure seems like it should work.  Is this an in-session limitation?

 

Thanks.

 

Joe Hendrickson

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report