iProps in Inventor 2018 have trailing zeros even when rounded to 0 D.P.

iProps in Inventor 2018 have trailing zeros even when rounded to 0 D.P.

Anonymous
Not applicable
1,177 Views
9 Replies
Message 1 of 10

iProps in Inventor 2018 have trailing zeros even when rounded to 0 D.P.

Anonymous
Not applicable

I have several iLogic driven templates set up for products, and have noticed since getting Inventor 2018 that rounding a custom iProperty to 0 decimal places, still displays it with .0 , even though Inventor does not recognise the .0.

 

For example, we have a custom iProperty for Mass in Air, when we run the 'Update Weights' rule, an input box asks for the number of decimal places required. When selecting '0' the resulting iProperty would read as 111.0 for example. Inventor 2017 did not have the .0 displayed.

 

If I try and remove the .0 zero by asking to go right 2 places, the iProperty would then give me '11'  which makes me think Inventor is not seeing the .0 even though it is displayed.

 

The attached screenshots show the actual mass, the 'WIA' iProperty with 2 decimal places, and with 0 decimal places.

The 0 decimal places displays '2.0' even though it should read '2'

 

Anyone else come across this or have a fix for it?

 

Chris Jones

0 Likes
1,178 Views
9 Replies
Replies (9)
Message 2 of 10

bradeneuropeArthur
Mentor
Mentor

This has all to do with the documentsettings.
change these and it will be correct.

 DocumentSettings.PNG

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 10

Anonymous
Not applicable

It doesn't work, already tried that. The custom iProperty still has the .0 on the end.

 

Inventor 2017 didn't have this issue even with having the precision at 3 DP in document settings.

0 Likes
Message 4 of 10

bradeneuropeArthur
Mentor
Mentor

can you upload the rule for the weight please.

The failure will be found there, since the WIA is no expression.

Because it is no expression the failure is in the rule.

 

Why are you not using:

 

WIA =<Mass>

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 10

Anonymous
Not applicable

This is what we use (it's a global rule).

 

We don't use the Mass property as in drawings if it is out of date, it displays 'N/A' so we created a mapped property so a value is always displayed.

 

The rule has always worked fine until we got 2018, and now we have this issue with the extra 0. Weights are important on our drawings as it is the offshore business.

 

Thanks for looking at this.

0 Likes
Message 6 of 10

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Think inventor changed a little:

 

this is working:

 

Dim Rounding As Integer
Rounding = InputBox("dd", "dddd", "0")
Dim m As Decimal= iProperties.Mass
MsgBox(Round(m,Rounding))
iProperties.Value("custom","WIA") = Round(m,Rounding).tostring

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 10

Anonymous
Not applicable

Great!

 

Thanks for that. Will give that a try and let you know how it goes.

0 Likes
Message 8 of 10

rhasell
Advisor
Advisor

This one caught my attention, because I run the same code.

 

I made some small changes to mine, and am unable to duplicate your error.

 

Is your Inventor patched etc?

 

Here is a copy of testing your code, combined with mine, it all works as expected.

 

(Its not the cleanest, just testing.)

 

Dim Rounding As Integer
Rounding = InputBox("dd", "dddd", "0")
iProperties.Value("Custom", "Totalmass") = Round(iProperties.Mass, Rounding) & " kg"
MessageBox.Show(iProperties.Value("Custom", "Totalmass"), "Title")
Reg
2026.1
0 Likes
Message 9 of 10

Anonymous
Not applicable

HI,

 

Yeah, Inventor is up to date with the latest patch.

 

I wonder if your code works better as your adding the "kg" on to the end of it where mine was just a number?

I'll try my code that way to see If that also fixes the error.

0 Likes
Message 10 of 10

bradeneuropeArthur
Mentor
Mentor

@Anonymous

 

Please try the earlier posted code with the correct declarations, as m as  decimal.

 

Dim Rounding As Integer
Rounding = InputBox("dd", "dddd", "0")
Dim m As Decimal= iProperties.Mass
MsgBox(Round(m,Rounding))
iProperties.Value("custom","WIA") = Round(m,Rounding).tostring

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes