cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement Units - Java API

Former Member
0 Kudos

Hello!

I have package dimensions stored in English units (inches and pounds) and I want to see them in metric using the Java API. I know MeasurementManager.GetString() is the method. My question is how do I convert "mm" or "kG" to the proper unitId for the last parameter (convertToUnits)?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

In MDM 4.0.58, here is what I had to do:

get the MeasurementManager from the CatalogData object

loop thru the MeasurementInfo objects to get the dimensions

for each MI object loop thru the UnitInfo objects

print the Id and Name on the console.

find the id's for "mm" under Length and "kg" under Weight (Mass).

Crude but effective. Was hoping there was a better way, but no one seems to know it.