Hi to all,
I'm quite new to this forum. I tried, but I did not find any similar topic, so I'm asking your help.
I'm using Inventor 2019 and I need to manage pressure in bar ( Pascall x 100000 )
I store this value in a unitless param called "pressure_bar".
Now I have to fill the param "pressur_psig" that is in [psi]
I expected to be able to write something like :
Parameter("PRESSURE_BAR") = ThisApplication.UnitsOfMeasure.ConvertUnits(Parameter("PRESSURE_PSI"),UnitsTypeEnum.kPSIPressureUnits, UnitsTypeEnum.kPascalPressureUnits) * 10^5
After a ton of attempts, that's what I find that works
Parameter("PRESSURE_BAR") = ThisApplication.UnitsOfMeasure.ConvertUnits(Parameter("DESIGN_PRESSURE_PSIG"), UnitsTypeEnum.kPSIPressureUnits, UnitsTypeEnum.kPSIPressureUnits)/ 10^2
Why? 😲
Can anyone explain it to me?
Thanks a lot!
Solved! Go to Solution.
Solved by albertuan. Go to Solution.
Sorry,
Now I have understood.
The "internal" Unit Of Measure of a PSI Parameter is KPascal.
The assignment of a PSI Parameter to a UnitLess Paramete assign to the UnitLess parameter the "internal" value in KPascal.
So, with my first attempt, I was doing a double conversion. The correct grammar is simply and assignment, and a reduction of factor 100 to convert KPascal in bar.
Parameter("PRESSURE_BAR") = Parameter("PRESSURE_PSIG") / 10^2
Where are true the two conditions:
Parameter.Param("PRESSURE_BAR").Units = UnitsTypeEnum.kUnitlessUnits
Parameter.Param("PRESSURE_PSIG").Units = UnitsTypeEnum.kPSIPressureUnits
Hope it could help others ... the assignment to a unitless parameter, with the automatic conversion to an "internal unit of measure", I didn't find it so intuitive.
🤔
Can't find what you're looking for? Ask the community or share your knowledge.