Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
gregor.leban
815 Views, 7 Replies

Inventor rule to change mm^2 to m^2

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)

Labels (1)
Anonymous
in reply to: gregor.leban

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

 

AREA.JPG

gregor.leban
in reply to: Anonymous

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

 

Brez naslova.png

 

 

Anonymous
in reply to: gregor.leban

Add something at the end.

 

iProperties.Value("Custom", "AreaM2") = Round(iProperties.Area / 1000000,2) & " m^2"
gregor.leban
in reply to: Anonymous

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?

Anonymous
in reply to: gregor.leban

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

gregor.leban
in reply to: Anonymous

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

Anonymous
in reply to: gregor.leban

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.