iLogic Integers Driven to Custom iProperties Incorrectly

iLogic Integers Driven to Custom iProperties Incorrectly

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

iLogic Integers Driven to Custom iProperties Incorrectly

Anonymous
Not applicable

My company has just recently upgraded from Inventor 2017 to 2018. Currently on 2018.1.1 (latest update). We've found an issue with the output from iLogic being driven incorrectly into Custom iProperties.

 

When using the code below, lets say mass is 402.5687 lb 

 

SyntaxEditor Code Snippet

iProperties.Value("Custom", "Mass")=Round(iProperties.Mass)

Inventor 2017 produces Mass = 403

Inventor 2018 produces Mass = 403.0

 

Essentially every function where the output is a whole number (i.e., Round, Ceil, Floor), iProperties attaches a .0 to it. I know several work-around's for this issue, but I would rather the function work like it did in 2017, where a whole number is driven out as a whole number. We do not wish to update all our templates. 

 

This seems like an issue that needs to be resolved in an Inventor update. If anyone has been able to resolve this issue without changing how that line is currently written, we would be glad to hear a solution.

0 Likes
Accepted solutions (2)
1,114 Views
9 Replies
Replies (9)
Message 2 of 10

bob_holland
Autodesk Support
Autodesk Support

@Anonymous

 

Welcome back to the forum.

My testing in 2017 is showing a trailing 0.

Can you please private message me a small sample of a 2017 model of yours that is not showing the trailing 0.

 

Thank you and I look forward to hearing from you soon.

 


Bob Holland
Autodesk Product Support
0 Likes
Message 3 of 10

Anonymous
Not applicable

Bob,

 

I've sent you a sample that has not yet been updated to 2018 via private message.

 

Most of our Custom iProperties are used in our drawing notes, so the issue became evident quite quickly when reviewing our Inventor 2018 drawings. 

 

Ryan

0 Likes
Message 4 of 10

bob_holland
Autodesk Support
Autodesk Support

@Anonymous

 

I have have sent you a reply through an support case so that you can provide me with a ZIP of a Pack and Go copy of your 2017 file in question.

 

Thank you.


Bob Holland
Autodesk Product Support
0 Likes
Message 5 of 10

bob_holland
Autodesk Support
Autodesk Support
Accepted solution

@Anonymous

 

I wanted to follow up with you and let you know that I have been able to replicate this issue and I have documented this and reported it to the Autodesk Inventor development staff with an incident ID of:  INVGEN-7680

 

A tracking page has been created so that you can follow it and be notified when it's status changes.

http://knowledge.autodesk.com/article/Inventor-2018-iLogic-Integers-become-decimals-when-driven-to-Custom-iProperties


Thank you again for your patience while we work to resolve this for you. 


Bob Holland
Autodesk Product Support
0 Likes
Message 6 of 10

nicolas.striebig
Enthusiast
Enthusiast

Hello,
I have the same issue.
In French, we use ',' for the decimal and instead of return 403.0 I have 403,
I hope you can find a solution.
Thanks,


Nicolas

0 Likes
Message 7 of 10

johnsonshiue
Community Manager
Community Manager

Hi Nicolas,

 

There is some update regarding this issue. Round() function returns a rounded double floating point value. It is not an integer. As a result, the trailing zero would be there. The way to force it show integer value is to convert the value to integer in the first place. For example, the following code would help convert Mass to an integer.

 

Dim number As Integer = Round(iProperties.Mass, 0)
iProperties.Value("Custom", "Mass") = number

 

Could you take a look?

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 8 of 10

nicolas.striebig
Enthusiast
Enthusiast

Hi,

 

In fact, here is my iLogic rule

 

Length = Round(Measure.ExtentsLength, 3)

iProperties.Value("Custom", "Encombrement_X")= Length

 

If the result is an integer i would like iProperties return 120 and not 120, or 120.0

But if the result is not an integer, I would like the digits after the decimal.

 

It was working well before (with Inventor 2011-2014-2016, not test with 2017) and I'm surprised it's not working well now ???

 

Where is the problem with 2018 ?

 

Thanks,

 

Nicolas

 

 

0 Likes
Message 9 of 10

johnsonshiue
Community Manager
Community Manager

Hi! The 2017 and earlier behavior was actually a bug in iProperties where the values were not properly honored. The internal double values were converted to integer with or without rounding. The issue was fixed in 2018 leading to the change in behavior you are seeing.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 10 of 10

Anonymous
Not applicable
Accepted solution

I'm not sure if this issue was ever addressed in any Inventor 2018 updates, but I can confirm in Inventor 2019, rounding works once again like the 2017 and earlier behavior.

 

Thanks,

rmeysenburg

0 Likes