
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I created a short Rule to change the iProperties of a part as I change the length of a piece of pipe (I know iParts would be the best way to create similar parts of different length, but it's a long story how I got to this point.) The length of pipe is either a whole number (#) or halfway between two numbers (#.5) My rule basically checks to see if the input is an integer or not and outputs a title and description that follows the nomenclature of my company. When I got to length of 51, my rule assumes it is not an integer, however any other integer, be it 49, 50 or 52, the rule works fine.
Why isn't "51" an integer?
Here is my code, where d2 is the length of the pipe:
If d2 = Int(d2) Then iProperties.Value("Project", "Description") = "TUBING, 1.500 OD X 0.125 W X " & d2 & ".000 LG" iProperties.Value("Summary", "Title") = "TUBING, 1.500 OD X 0.125 W X " & d2 & ".000 LG" MsgBox(d2 & " is an integer") Else iProperties.Value("Project", "Description") = "TUBING, 1.500 OD X 0.125 W X " & d2 & "00 LG" iProperties.Value("Summary", "Title") = "TUBING, 1.500 OD X 0.125 W X " & d2 & "00 LG" MsgBox(d2 & " is not an integer") End If
I added message boxes to confirm that it thinks 51 is not an integer.
Solved! Go to Solution.