Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi,
in MathCad i have defined variable as
wllston = 17.32 lbf
when i read its value in API i am getting this value : "77.0462622041584"
is there any way so i will have same value as in MathCad.
Set oResult = msheet.GetValue("wllston")
output : value "77.0462622041584"
required output : 17.32
Thanks in advance !!!
Solved! Go to Solution.
Rais Patel wrote:
Hi,
in MathCad i have defined variable as
wllston = 17.32 lbf
when i read its value in API i am getting this value : "77.0462622041584"
is there any way so i will have same value as in MathCad.
Set oResult = msheet.GetValue("wllston")
output : value "77.0462622041584"
required output : 17.32
The number you get is what your force would be in Newton. Its what you also get in Mathcad if you evaluate wllston/UnitsOf(wllston).
So Mathcad seems to store the value in standard force unit and remembers that the dimension is force.
With GetValue you obviously get only the value, not the unit.
So you have two ways out:
1) divide the value you get with GetValue by 4.4482216... Thats one pound force in Newton
or
2) define a new variable in Mathcad which holds the value 17.32... without unit and use GetValue on this variable. You achieve this by dividing your variable by lbf
Rais Patel wrote:
Hi,
in MathCad i have defined variable as
wllston = 17.32 lbf
when i read its value in API i am getting this value : "77.0462622041584"
is there any way so i will have same value as in MathCad.
Set oResult = msheet.GetValue("wllston")
output : value "77.0462622041584"
required output : 17.32
The number you get is what your force would be in Newton. Its what you also get in Mathcad if you evaluate wllston/UnitsOf(wllston).
So Mathcad seems to store the value in standard force unit and remembers that the dimension is force.
With GetValue you obviously get only the value, not the unit.
So you have two ways out:
1) divide the value you get with GetValue by 4.4482216... Thats one pound force in Newton
or
2) define a new variable in Mathcad which holds the value 17.32... without unit and use GetValue on this variable. You achieve this by dividing your variable by lbf
I have an objection.
You should not call F/lbf the variable name 'Funitless', but rather 'F_in_lbf', or any other clarification that the variable's value is in lbf... But it certainly isn't unitless!
Other than that I'm fine with it.
Regards,
Luc
LucMeekes wrote:
I have an objection.
You should not call F/lbf the variable name 'Funitless', but rather 'F_in_lbf', or any other clarification that the variable's value is in lbf... But it certainly isn't unitless!
The variable itself IS unitless, but of course we associate a unit with its value, given the context.
So I agree that your suggestions for naming that variable might be the better choice.