Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all;
I have a lifting bollard with standart capacities , most of dimensions change according to capacity , including "Q , D, F" inputs from the rule.
But I want to put a private option here , if I click private "Yes" , I want take precedence "Q , D, F" inputs from the form. If I do private selection "No" it will take dimensions from as in the Rule's if statements.
You will see my whole rule below, I tried to add case options but I am not so much experienced with that , probably I need to do something better or professional.
I also added my model here , I am working Inventor 2021 .
If you help me in this issue I would be grateful, thanks in advance .
Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oDoc.ComponentDefinition ' Get the top level occurrence of an assembly Dim oOcc1 As ComponentOccurrence oOcc1 = oDef.Occurrences.Item(1) 'Master component occurrence Dim oOccA As String oOccA = oOcc1.Name 'Name Master component Dim oOcc4 As ComponentOccurrence oOcc4 = oDef.Occurrences.Item(4) 'Back plate Dim oOccD As String oOccD = oOcc4.Name 'Back plate MultiValue.SetList("Capacity", "010T", "020T", "035T", "050T", "065T", "075T", "090T", "100T", "110T", "125T") MultiValue.SetList("Private", "No", "Yes") Parameter(oOccA, "A_")=A_ Parameter(oOccA, "B_")=B_ Parameter(oOccA, "C_")=C_ Parameter(oOccA, "D_")=D_ Parameter(oOccA, "E_")=E_ Parameter(oOccA, "F_")=F_ Parameter(oOccA, "G_")=G_ Parameter(oOccA, "H_")=H_ Parameter(oOccA, "J_")=J_ Parameter(oOccA, "K_")=K_ Parameter(oOccA, "L_")=L_ Parameter(oOccA, "N_")=N_ Parameter(oOccA, "M_")=M_ Parameter(oOccA, "Q_")=Q_ Parameter(oOccA, "Lk")=Lk Parameter(oOccA, "Flange_Depth")=Flange_Depth Parameter(oOccA, "Flange_Thk")=Flange_Thk Parameter(oOccA, "Wall_Thk") = Wall_Thk Parameter(oOccA, "Gap") = Gap Parameter(oOccA, "d16") = Z Select Case Private Case "Yes" Q_ = Q_ D_ = D_ F_ = F_ Case "No" Dim Q_ As String Dim D_ As String Dim F_ As String End Select If Capacity = "010T" Then A_ = 114.3 B_ = 10 C_ = 75 D_ = 8 E_ = 0.01 F_ = 300 G_ = 140 H_ = 180 J_ = 260 K_ = 0.01 L_ = 130 N_ = 10 M_ = 0.01 Q_ = 140 Component.Visible(oOccD) = False End If If Capacity = "020T" Then A_ = 168.3 B_ = 12.5 C_ = 80 D_ = 8 E_ = 0.01 F_ = 300 G_ = 200 H_ = 260 J_ = 290 K_ = 0.01 L_ = 130 N_ = 10 M_ = 0.01 Q_ = 140 Component.Visible(oOccD) = False End If If Capacity = "035T" Then A_ = 219.1 B_ = 16 C_ = 90 D_ = 12 E_ = 0.01 F_ = 300 G_ = 240 H_ = 310 J_ = 310 K_ = 0.01 L_ = 130 N_ = 16 M_ = 0.01 Q_ = 170 Component.Visible(oOccD) = False End If If Capacity = "050T" Then A_ = 229 B_ = 25 C_ = 100 D_ = 20 E_ = 0.01 F_ = 340 G_ = 250 H_ = 370 J_ = 320 K_ = 0.01 L_ = 130 N_ = 16 M_ = 0.01 Q_ = 170 Component.Visible(oOccD) = False End If If Capacity = "065T" Then A_ = 244.5 B_ = 30 C_ = 105 D_ = 20 E_ = 20 F_ = 400 G_ = 270 H_ = 380 J_ = 340 K_ = 330 L_ = 140 N_ = 16 M_ = 1340 Q_ = 170 Component.Visible(oOccD) = True End If If Capacity = "075T" Then A_ = 273 B_ = 30 C_ = 115 D_ = 20 E_ = 20 F_ = 420 G_ = 300 H_ = 410 J_ = 350 K_ = 350 L_ = 140 N_ = 16 M_ = 1350 Q_ = 200 Component.Visible(oOccD) = True End If If Capacity = "090T" Then A_ = 323.9 B_ = 30 C_ = 115 D_ = 20 E_ = 20 F_ = 500 G_ = 360 H_ = 470 J_ = 380 K_ = 430 L_ = 140 N_ = 20 M_ = 1380 Q_ = 210 Component.Visible(oOccD) = True End If If Capacity = "100T" Then A_ = 355.6 B_ = 30 C_ = 130 D_ = 20 E_ = 20 F_ = 530 G_ = 380 H_ = 500 J_ = 400 K_ = 460 L_ = 140 N_ = 20 M_ = 1600 Q_ = 220 Component.Visible(oOccD) = True End If If Capacity = "110T" Then A_ = 368 B_ = 30 C_ = 130 D_ = 20 E_ = 20 F_ = 550 G_ = 400 H_ = 540 J_ = 400 K_ = 480 L_ = 140 N_ = 20 M_ = 1600 Q_ = 240 Component.Visible(oOccD) = True End If If Capacity = "125T" Then A_ = 457 B_ = 30 C_ = 130 D_ = 25 E_ = 25 F_ = 600 G_ = 480 H_ = 620 J_ = 450 K_ = 520 L_ = 140 N_ = 20 M_ = 1600 Q_ = 230 Component.Visible(oOccD) = True End If If (Q_ - 2 * D_) < (Flange_Depth - Gap - Wall_Thk - 10) Z = (Flange_Depth - Gap - Wall_Thk) -(Q_ - 2 * D_) Else Z = 10 End If If U_Beam_Width < 100 U_Beam_Width = 100 MessageBox.Show("The minimum value allowed for this parameter is: " & U_Beam_Width & vbCr & "The value will be automatically corrected to the minimum.", "Minimum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) ElseIf U_Beam_Width > 500 Then U_Beam_Width = 500 MessageBox.Show("The maximum value allowed for this parameter is: " & U_Beam_Width & vbCr & "The value will be automatically corrected to the maximum.", "Maximum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) End If If U_Beam_Depth < 100 U_Beam_Depth = 100 MessageBox.Show("The minimum value allowed for this parameter is: " & U_Beam_Depth & vbCr & "The value will be automatically corrected to the minimum.", "Minimum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) ElseIf U_Beam_Depth > 400 Then U_Beam_Depth = 400 MessageBox.Show("The maximum value allowed for this parameter is: " & U_Beam_Depth & vbCr & "The value will be automatically corrected to the maximum.", "Maximum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) End If If Lk < 1000 Lk = 1000 MessageBox.Show("The minimum value allowed for this parameter is: " & Lk & vbCr & "The value will be automatically corrected to the minimum.", "Minimum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) ElseIf Lk > 5000 Then Lk = 5000 MessageBox.Show("The maximum value allowed for this parameter is: " & Lk & vbCr & "The value will be automatically corrected to the maximum.", "Maximum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) End If RuleParametersOutput() iLogicVb.RunRule("U-Beam") InventorVb.DocumentUpdate(True)
Solved! Go to Solution.