- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.