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: 

Scripting: Adding BOM issue

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
511 Views, 2 Replies

Scripting: Adding BOM issue

Hi,

 

I have written a script which tryes to add BOM on modifying of "Items and BOMs" item.

 

No errors during the testing in PLM360 UI. But I have an error during real execution. We have created a .NET application where we have an error "At least one of the input values was set to an illegal value."

 

BOM part of script:

var item1 = loadItem(2998);
var res= item.boms.addBOM({RELATED:item1, QUANTITY:1});

Item with id 2998 is real.

Additionally we have a message from View Log: [SLDOnModify] java.lang.NullPointerException: null.

 

We see the error because of second string (var res= item.boms.addBOM({RELATED:item1, QUANTITY:1});). If line commented, the error will be disappeared.

 

So I can't add item at the BOM of item which I try to modify. Do you know where the problem can be?

 

Best regards, Vitaliy

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

Hi Vitaliy,

 

Here is my simple script that will allow you to write to the BOM Tab.

 

See Attachments for reference.

 

This action script can be utilize in the behavior setting or the workflow.

 

if(item.BOM_LINK !== null){
item.boms.addBOM({
RELATED: item.BOM_LINK,
QUANTITY: 1,
ITEM_NUMBER:1
});
}

 

thanks,

 

Trung

Trung Nguyen | PLM Product Management | Autodesk, Inc.
Message 3 of 3
liumi
in reply to: Anonymous

The item number must be specified in the addBOM function, so try this and replace # with your item number.

 

var item1 = loadItem(2998);
var res= item.boms.addBOM({RELATED:item1, QUANTITY:1, ITEM_NUMBER:#});

 



Michal Liu
Software Engineer
Product Lifecycle Management
Autodesk, Inc.

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

Post to forums  

Autodesk Design & Make Report