PI returning value for 10*PI

PI returning value for 10*PI

m.reyes74B3T
Contributor Contributor
1,284 Views
6 Replies
Message 1 of 7

PI returning value for 10*PI

m.reyes74B3T
Contributor
Contributor

I am using PI in a parameter but when I got my final calculation the value seemed a bit off. I checked on paper and turned out it was. I went through each of the expressions on the formula and narrowed the problem down to PI being off by a factor of 10.

 

Anyone else have this problem? 

 

I'm on Inventor Professional 2018

pi value.PNG

0 Likes
Accepted solutions (1)
1,285 Views
6 Replies
Replies (6)
Message 2 of 7

WHolzwarth
Mentor
Mentor

I can see it, too.

I think, it's caused by Inventor's calculation base in cm.

Normally, PI can not be inserted in mm, only unitless (ul). It's ok there.

But after switching unit from ul to mm after that, factor 10 appears.

Walter Holzwarth

EESignature

Message 3 of 7

m.reyes74B3T
Contributor
Contributor

Strange that it seemingly randomly chooses to convert to cm or multiply/divide by 10...

 

Even in a full formula it's still off by a factor of 10.

still wrong.PNG

 

However when I change the mm to mm^2 (as it should be), it now returns the correct value.

now right.PNG

 

I found an alternative method to do what I wanted to do (calculate tube length using volume and cross sectional area) by writing the equations in iLogic rather than doing all the calculations in parameters. Turns out that it ended up being a lot cleaner and I can easily use the new custom iProperty on my drawings!iLogic method.PNG

 

 

Message 4 of 7

johnsonshiue
Community Manager
Community Manager

Hi! PI should be unitless. I don't understand why when a mm parameter equals to PI, the value is 31.416mm. I think it is an equation parser's bug.

The results in the image you attached are interesting. The upper one is due to inconsistent units. The parameter is set to be mm unit but the result is actually mm^2. You will see erroneous result.

The lower one is correct since the units are in sync.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 5 of 7

rst65D25
Observer
Observer
I, a beginner, struggled to enter either a unitless or distance value of PI. I needed 3.14159... mm. After a bit of a struggle I found that isolate(PI rad;rad;mm) worked. Remember to use semicolons as separators, not commas! By extension, this ugly formula yields a unitless value for pi: isolate(isolate(PI rad;rad;mm);mm;ul) There must be a better way!
0 Likes
Message 6 of 7

SBix26
Consultant
Consultant
Accepted solution
PI is unitless, so there is no need to do a double Isolate function. Also, if you need π mm, then the easiest method is simply PI * 1 mm. SamB
Message 7 of 7

rst65D25
Observer
Observer
Well, that is certainly much easier!
Thank you very much.
My confusion partially arose because you can enter 'PI rad' to an angle edit box. But you can't enter just 'PI mm' into a distance edit box. This made me think the PI must be an angle, so I would have to perform a typecast.
0 Likes