- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a Case with four (4) options. Each option creates a different Description in iProperties. What am I doing wrong? This format is identical to what is shown all over the place online but nothing happens. I wanted to avoid having If/Then repeating but it feels like that can't be avoided even with Case. Please help out.
Select Length
Case "1" 'A-small_C-small
If (Me.Parameter(Me, "DIA1") < .250) & (Me.Parameter(Me, "DIA2") < .250) Then
iProperties.Value("Project", "Description") = "STUD, SHOULDERED, MALE, #" & ThreadTextA & " X " & ThreadLenA & """ L TO #" & ThreadTextC & " X " & ThreadLenC & """ L"
End If
Case "2" 'A-small_C-big
If (Me.Parameter(Me, "DIA1") < .250) & (Me.Parameter(Me, "DIA2") >= .250) Then
iProperties.Value("Project", "Description") = "STUD, SHOULDERED, MALE, #" & ThreadTextA & " X " & ThreadLenA & """ L TO " & ThreadTextC & " X " & ThreadLenC & """ L"
End If
Case "3" 'A-big_C-small"
If (Me.Parameter(Me, "DIA1") >= .250) & (Me.Parameter(Me, "DIA2") < .250) Then
iProperties.Value("Project", "Description") = "STUD, SHOULDERED, MALE, " & ThreadTextA & " X " & ThreadLenA & """ L TO #" & ThreadTextC & " X " & ThreadLenC & """ L"
End If
Case "4" 'A-big_C-big
If (Me.Parameter(Me, "DIA1") >= .250) & (Me.Parameter(Me, "DIA2") >= .250) Then
iProperties.Value("Project", "Description") = "STUD, SHOULDERED, MALE, " & ThreadTextA & " X " & ThreadLenA & """ L TO " & ThreadTextC & " X " & ThreadLenC & """ L"
End If
End Select
Select Case True
Case Length = 1
MessageBox.Show("1: Small,Small")
Case Length = 2
MessageBox.Show("2: Small,Big")
Case Length = 3
MessageBox.Show("3: Big,Small")
Case Length = 4
MessageBox.Show("4: Big,Big")
End Select
https://www.youracclaim.com/badges/9aa4a1d5-0d02-4888-be6f-ed8f0653d8ad/public_url
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! I am not an iLogic expert. Nor do I know VB.Net well. But, I don't understand what "Select Case True" is. Is it a typo?
Many thanks!

Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
ever understand how to use Case.
So, the sample I modified came from:
https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/
CloudHelp/cloudhelp/2014/ENU/Inventor/files/GUID-050DC8F2-6F4D-4CCC-8469-ACC
481A38BC2-htm.html
But it never makes sense how to trigger Case.
https://www.youracclaim.com/badges/9aa4a1d5-0d02-4888-be6f-ed8f0653d8ad/public_url
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! Why have two different Select statements? Can you condense this code to run with one Select statement? It appears that the second Select statement uses the Length variable just like the first one does.
Here is an example of condensing the two Select statements into one.
Select Length
Case "1" 'A-small_C-small
If (Me.Parameter(Me, "DIA1") < .250) & (Me.Parameter(Me, "DIA2") < .250) Then
iProperties.Value("Project", "Description") = "STUD, SHOULDERED, MALE, #" & ThreadTextA & " X " & ThreadLenA & """ L TO #" & ThreadTextC & " X " & ThreadLenC & """ L"
End If
Messagebox.Show("1: Small,Small")
Case "2" 'A-small_C-big
'... etc.
End Select
And just a quick thing about Select statements. Hope this helps!
Select length ' Here length is the variable you want to check
Case 1 ' Read this line as, "When length = 1 do this"
MessageBox.Show("Length is 1!")
Case 2 ' You can also read this as, "If length = 2, then do this"
MessageBox.Show("Length is 2!")
End Select
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This works wonderfully, thank you @ianteneth ! This is going to help take designs here much farther than before.
https://www.youracclaim.com/badges/9aa4a1d5-0d02-4888-be6f-ed8f0653d8ad/public_url