Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic Sheet metal properties

pball
Advisor

iLogic Sheet metal properties

pball
Advisor
Advisor

I just made some iLogic to setup a formatted description of the material and thickness. Most of it works great but one thickness is not being detected. Attached is a test part that is having an issue with the 12ga thickness.

 

I am using a select statement to set a gauage thickness in a description but 12ga (0.1046) does not work. If I change it to 0.1045 in the script and then set the thickness to that it works, but not at the correct value. When the part thickness is 0.1046 the select statement goes to the select else which formats the thickness as a decimal number.

 

EX:

 

Select Case Parameter("Thickness")
    Case 0.1046
        ShtThk = "12GA"

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Reply
Accepted solutions (1)
499 Views
3 Replies
Replies (3)

NSBowser
Advocate
Advocate
Accepted solution

PBALL,

 

I've seen this come about a few other times where during comparisons some tiny decimal portion is attached to the end of a measurement (think .1046000000001)

As a result numerical equality comparisions fail. I've seen a few ways to handle this by adapting for a given tolerance threshold, such as the  EqualWithinTolerance command.

In the case of a Select Case operation (no pun intended) I would use a range to define each value, though we all know you shouldn't have to do this.

Here is a sample of what I would employ. It doesn't require a very large range, just enough to nullify the tiny discrepency.

 

	Case 0.10459 To .10461

Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes

pball
Advisor
Advisor
Thanks, that fix works great. I've seen that extra tiny amount added to content center profiles or something before in the past but never thought about that for this issue. You also taught me more about the select operation, didn't know you could do ranges. I mostly do VBA scripts and that doesn't support select case sadly.
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes

NSBowser
Advocate
Advocate

Definitely worth knowing the advanced Select Case Functionality. There are few more things you might find useful as well

 

'Accept two Cases in One
Case 0.1046, 0.1196

'Greater than (and Less Than)
Case >0.1196

 

Check out the Microsoft MSDN on it for more detail.


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes