Message 1 of 4
iLogic code to check dimensions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to write a code to check reference dimensions in an ipt. These dimensions should only be checked if specific features are active. The dimensions would be checked against a minimum limit. An over-simplified code would be something like this:
checkDim = 230 If Feature.IsActive("Feature1") = True And Feature.IsActive("Feature2") = False Then 'Check Left Dimension If d01 < checkDim Then MessageBox.Show("Dimension too small", "Error") 'Check Right Dimension ElseIf d02 < checkDim Then MessageBox.Show("Dimension too small", "Error") End If ElseIf Feature.IsActive("Feature1") = True And Feature.IsActive("Feature2") = True Then 'Check Left Dimension If d01 < checkDim Then MessageBox.Show("Dimension too small", "Error") End If 'Check Right Dimension If d03 < checkDim Then MessageBox.Show("Dimension too small", "Error") End If 'Check Center Dimension If d04 < checkDim Then MessageBox.Show("Dimension too small", "Error") End If End If
Writing the code this way seems to cause the rule to run multiple times and the message box pops up 4 times every time the rule runs. I'm sure there's an easier way, but I can't figure it out. Any help would be appreciated!