Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.


Register Today
COE 2009 Annual PLM Conference & TechniFair

COE DISCUSSION FORUM
Subject: Is ConvertFromMKS method (from Unit Class) useless ?

You are not authorized to post a reply.   
Author Messages
nBouikni19

13 Nov 2008 11:16 AM

Hi everybody,

Before using the ConvertFromMKS function from the (unit Class), I expected from this function to convert my length value from MKS (mm) to Inch (unit selected form option->parameters->unit -> length = INCH). Unfortunately, the result was multiplied by 100 (*100). I got the same result from functions: ConvertFromStorageUnit. So my question is : are those fucntions (Methodes belonging to the Unit Class) Useless ?

 

Cordially

 

 

PGUY

14 Nov 2008 06:48 AM
No I have just done this and it worked for me

'Set unit object to the unit that reperesents the target units
Set oUnit = oUnits.Item(i)
'Convert the number we have in storage units to target units
dMass = oUnit.ConvertFromStorageUnit(dMass)

If your value is in someting other than storage units you will have to get the units object for the current units, convert to storage units then do the above (get the target units object & convert from storage to desired type)

The MKS functions are going to behave in a similar way but I would avoid using the two together as you may get a shift in the magnitude of the result. (though I would expect a order of magnitude not 2 orders of magintude, but code could have done it twice)
http://www.unc.edu/~rowlett/units/cgsmks.html
You are not authorized to post a reply.
Forums > COE Forums > CATIA V5 Programming > Is ConvertFromMKS method (from Unit Class) useless ?



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)