Inventor rule to change mm^2 to m^2

Inventor rule to change mm^2 to m^2

gregor.leban
Enthusiast Enthusiast
1,000 Views
7 Replies
Message 1 of 8

Inventor rule to change mm^2 to m^2

gregor.leban
Enthusiast
Enthusiast

Hi,

I write a rule:

iProperties.Value("Custom", "AreaM2") = Round(iProperties.Area / 1000000,2)

That part is working.
However, in drawing I only get numbers. I would like to get a unit as well (and not writing it manually).

Perhaps is a dumb question, but I just can't figure it out...

(Inventor 2020)

0 Likes
Accepted solutions (1)
1,001 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Hello @gregor.leban . You can format your titleblock or just add text with format. Please see the snapshot.

 

AREA.JPG

0 Likes
Message 3 of 8

gregor.leban
Enthusiast
Enthusiast

Is it possible to have that write in code, like here with Mass :

 

Brez naslova.png

 

 

0 Likes
Message 4 of 8

Anonymous
Not applicable
Accepted solution

Add something at the end.

 

iProperties.Value("Custom", "AreaM2") = Round(iProperties.Area / 1000000,2) & " m^2"
0 Likes
Message 5 of 8

gregor.leban
Enthusiast
Enthusiast

Thank you!

I have the same code for volume:

iProperties.Value("Custom", "VolumeM3") = Round(iProperties.Volume / 1000000000,5) & " m^3"

 

But here something weird happens when I add  your solution at the end...
It transforms result from 0,00004 to 4E-05
Why?

0 Likes
Message 6 of 8

Anonymous
Not applicable

It works fine here. That "E" , I think it means something cannot be displayed like may its too long. Try with smaller part.

0 Likes
Message 7 of 8

gregor.leban
Enthusiast
Enthusiast

Yes, with bigger part it is working normally but with smaller it display that E-.
Wonder why.

0 Likes
Message 8 of 8

Anonymous
Not applicable

with 1mm x 10mm part, i got the same.

iProperties.Value("Custom", "VolumeM3") = Round(iProperties.Volume / 1000000000,5) & " m^3"

Maybe you can use less decimal, but you will probably get zero value. So, maybe better not use  m^3.

0 Likes