Decimal places in iLogic form

Decimal places in iLogic form

Curtis_Waguespack
Consultant Consultant
110 Views
5 Replies
Message 1 of 6

Decimal places in iLogic form

Curtis_Waguespack
Consultant
Consultant

Problem with decimal places in iLogic form in Inventor 2025. See attached files.

 

Here is the issue:

Curtis_Waguespack_3-1757611717569.png

Curtis_Waguespack_0-1757612178652.png

 

 

I thought I knew how to control this, by handing the value to a variable in a rule, rounding it, and then pushing that rounded value back out to the parameter, like this.

Curtis_Waguespack_2-1757611705057.png


But I'm not getting that to work, now. Not sure if something changed, or...

Does anyone know how to fix this?

 

Note that some increments display as expected

Curtis_Waguespack_0-1757611507209.png

 

others do not

Curtis_Waguespack_1-1757611522294.png

 

 

 

EESignature

0 Likes
Accepted solutions (1)
111 Views
5 Replies
Replies (5)
Message 2 of 6

marcin_otręba
Advisor
Advisor
Accepted solution

Hi,

 

In Inventor 2025, they moved to .NET 8. The change is to use more decimal places when converting a floating point number to a string. Unfortunately, this can introduce noise. 

they suggest to use value.ToString("G1") but it doesn't work,

 

it works for  me only if i change expression to something without digits after comma before i set real value like :

Dim pr As Inventor.Parameter = ThisDoc.Document.componentdefinition.parameters("Offset2")
Dim v As Double = pr.Value/2.54
pr.Expression=1
pr.Expression =Round(v,1)

also i added this rule to be triggered on parameter change.. 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 3 of 6

Curtis_Waguespack
Consultant
Consultant

Thanks for the reply @marcin_otręba, unfortunately I get the same result:

Curtis_Waguespack_0-1757688203624.png

 

 

@MjDeck , do you have a suggestion for getting this to work as expected?

EESignature

0 Likes
Message 4 of 6

marcin_otręba
Advisor
Advisor

@Curtis_Waguespack  and did you set rule to be triggered on parameter change ?

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 5 of 6

Curtis_Waguespack
Consultant
Consultant

@marcin_otręba,

ooops, it looks like I accidentally dragged it to the wrong event trigger earlier. I just checked again and this does work!
Thanks again!

setting it up like this, works as well:

oTrigger = Offset2
Dim pr As Inventor.Parameter = ThisDoc.Document.componentdefinition.parameters("Offset2")
Dim v As Double = pr.Value/2.54
pr.Expression=1
pr.Expression =Round(v,1)

 

EESignature

0 Likes
Message 6 of 6

MjDeck
Autodesk
Autodesk

Hi Curtis, thanks for reporting this. I created issue INVGEN-86825 for it. We should be able to fix it soon.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes