You were heading in the right direction. ProUnitConversionGet will eventually trace unit conversion to Inch-Pound-Second which is Pro/E default.The sequence of function calls as follows:
Init unit, or access it with ProMdlPrincipalUnitsystemGet, ( writing by memory, check function spelling)
ProUnitInit( mdl, L"mm", &mm_unit);
ProUnitInit( mdl, L"m", &m_unit);
ProUnitInit( mdl, L"cm", &cm_unit);
Then use ProUnitConversionGet, such as:
ProUnitConversionGet( &mm_unit, &convert_factor, &base_unit);
then check what is base_unit. If it is not inch, then call ProUnitConversionGet recursively until you end up at inches.
ProUnitConversionGet( &base_unit, &base_convert_factor, &basebase_unit);
In Reply to Patrick Williams:
Does anyone know how in Pro/TOOLKIT to take a number value in meters and convert it to inches? I don't want to hard code all sorts of conversion factors and was hoping to use ProUnitConverstionGet() but I'm confused as to how this function works. Technical support isn't very helpful either.
Patrick Williams | Engineering Systems | o: 616.698.3766 | c: 616.947.2110
Hi @ all,
but when you get out the conversion faktor and use (1 / conv_factor) and get this in as new conv.factor. The output should be the right converted unit?
Only problem is on temperature with the offset problem.