We must determine the part numbers to use for the union screws and elbows. To do this, we create additional rules in our assembly.
The first part of this rule calculates a part number to use for the Port A screw, based on the value of the port_a_size parameter. In this rule, we use a new statement Select Case to execute one of a group of statements. The statements executed depend on the value of an expression.
Select Case port_a_size Case .50 Screw_num1 = 050 Case .75 Screw_num1 = 075 Case 1.00 Screw_num1 = 100 Case 1.25 Screw_num1 = 125 Case 1.50 Screw_num1 = 150 Case 2.00 Screw_num1 = 200 Case 2.50 Screw_num1 = 250 Case 3.00 Screw_num1 = 300 End Select port_a_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"
In the rule we have created, if port_a_size = 0.50, the part number is created as -
UNBRAKO-050-SCREW
We save this value in a parameter for later reference.
Select Case port_b_size Case .50 Screw_num1 = 050 Case .75 Screw_num1 = 075 Case 1.00 Screw_num1 = 100 Case 1.25 Screw_num1 = 125 Case 1.50 Screw_num1 = 150 Case 2.00 Screw_num1 = 200 Case 2.50 Screw_num1 = 250 Case 3.00 Screw_num1 = 300 End Select port_b_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"
Select Case port_c_size Case .50 Screw_num1 = 050 Case .75 Screw_num1 = 075 Case 1.00 Screw_num1 = 100 Case 1.25 Screw_num1 = 125 Case 1.50 Screw_num1 = 150 Case 2.00 Screw_num1 = 200 Case 2.50 Screw_num1 = 250 Case 3.00 Screw_num1 = 300 End Select port_c_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"