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

Set custom UOM while creating a new Part with using code.

apatil-2
1-Newbie

Set custom UOM while creating a new Part with using code.

I have custom UOM in Windchill loaded to QuantityUnitRB, but I am not able to create a new Part with custom UOM using code.

getting the values via

QuantityUnit[] qu = QuantityUnit.getQuantityUnitSet();

but when I set to part, getting null pointer .

Has anyone come across this. Please suggest the way to do this.

Thank You,

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

Got Solution.

I tried,part.setDefaultUnit(QuantityUnit.toQuantityUnit("custom UOM"));

Thank you for you response

View solution in original post

2 REPLIES 2

Set it via LWCNormalizedObject, using this class to create the part, get the pointer, and then setting that attribute before checking in. Covered in the javadoc.

For the future, if you are going to say you get a NPE, you have to post the stacktrace, or the actual java code, providing details about how it is executed/invoked, or you will not typically get a lot of help.

Hi,

Got Solution.

I tried,part.setDefaultUnit(QuantityUnit.toQuantityUnit("custom UOM"));

Thank you for you response

View solution in original post

Announcements