Reply
Solved! Go to solution

How can we retrive the units of a document?

In other words, under file propertie we set M, Inch mm and we want to retrive this infomation

3 REPLIES
Solution
Solution
Accepted by burhop (Siemens Valued Contributor)
‎08-26-2015 04:32 AM

SolidDNA,   dim objDoc as your SE document, you can refer...

SolidDNA,

 

dim objDoc as your SE document, you can reference the units of measure by

 

objDoc.UnitsOfMeasure.Item(x).Units

 

There are several types (Length, Angle, Mass etc) that you can reference by using it's item number (x):

 

item(1) = Linear

item(2) = angular

...

This will return an integer, to decode look up the UnitOfMeasure Enumerations in your SDK help file. So for linear units look at UnitOfMeasureLengthReadoutConstants Enumeration; 17 is milimeters, 15 is meters ect. Using some handy code and arrays you can match the integer with a string so you get text instead of numbers.

 

Hope this helps.

Re: SolidDNA,   dim objDoc as your SE document, you can refer...

Thank you Tom

Will notify the programmer on monday about this

Have a good weekend

Re: SolidDNA,   dim objDoc as your SE document, you can refer...

[ Edited ]

Tom my programer found this as well, wanted to share.

 

He seems to prefer this. I'm not a coder so will let you debate which method is better. If you feel there is drawback let me know and I'll forward the info

He use igUnitDistance

http://dl2.plm.automation.siemens.com/solidedge/api/sesdk_web/UnitsOfMeasure.html#hs-inthistopic-5ba...

SolidEdgeConstants.UnitTypeConstants

And he was able to get the information. Explanation here might be short has i did not fully remember everything. Anyone who wantd to add more info are welcome to share.