Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi all,
Patric,
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);
HIH.
Feliks.
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
[cid:image001.jpg@01CD64EB.AAE15A40]
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.
Best regards,
Eike