Riferimento testo della regola

Di seguito viene riportato un riferimento al testo completo di tutte le regole riportate in questa esercitazione. Tali regole sono anche disponibili nella loro forma completa nel file manifold_block_complete.iam, incluso nella directory Tutorials.

Assembly_To_Parts_Rule

Copiare il blocco di codice sottostante

Parameter("manifold_block:1", "block") = block
Parameter("manifold_block:1", "component_type") = component_type
Parameter("manifold_block:1", "port_a_size") = port_a_size
Parameter("manifold_block:1", "port_b_size") = port_b_size
Parameter("manifold_block:1", "port_c_size") = port_c_size

Component_Type_Rule

Copiare il blocco di codice sottostante

If component_type = "standard" Then
port_b_size = port_a_size
port_c_size = port_a_size
End If

Port_A_Rule

Copiare il blocco di codice sottostante

i = iPart.FindRow("port_a_union", "port_size", "=", port_a_size)
port_a_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")
port_a_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

If port_a_size = .50 then
iPart.ChangeRow("port_a_union_screw", "Screw-01")
elseif port_a_size = .75 then
iPart.ChangeRow("port_a_union_screw", "Screw-02")
elseif port_a_size = 1.00 then
iPart.ChangeRow("port_a_union_screw", "Screw-02")
elseif port_a_size = 1.25 then
iPart.ChangeRow("port_a_union_screw", "Screw-03")
elseif port_a_size = 1.50 then
iPart.ChangeRow("port_a_union_screw", "Screw-04")
elseif port_a_size = 2.00 then
iPart.ChangeRow("port_a_union_screw", "Screw-04")
elseif port_a_size = 2.50 then
iPart.ChangeRow("port_a_union_screw", "Screw-05")
elseif port_a_size = 3.00 then
iPart.ChangeRow("port_a_union_screw", "Screw-06")
End If

port_a_union_part_number = iProperties.Value("port_a_union", "Project", "Part Number")

Port_B_Rule

Copiare il blocco di codice sottostante

If block = "elbow" Then
isTee = False
Else
isTee = True
End If

Constraint.IsActive("port_b_cap_center") = isTee
Constraint.IsActive("port_b_cap_hole") = isTee
Constraint.IsActive("port_b_cap_face") = isTee
Constraint.IsActive("port_b_cap_screw") = isTee
Component.IsActive("port_b_union") = isTee
Component.IsActive("port_b_screw_pattern") = isTee

If port_b_size = .50 then
iPart.ChangeRow("port_b_union_screw", "Screw-01")
elseif port_b_size = .75 then
iPart.ChangeRow("port_b_union_screw", "Screw-02")
elseif port_b_size = 1.00 then
iPart.ChangeRow("port_b_union_screw", "Screw-02")
elseif port_b_size = 1.25 then
iPart.ChangeRow("port_b_union_screw", "Screw-03")
elseif port_b_size = 1.50 then
iPart.ChangeRow("port_b_union_screw", "Screw-04")
elseif port_b_size = 2.00 then
iPart.ChangeRow("port_b_union_screw", "Screw-04")
elseif port_b_size = 2.50 then
iPart.ChangeRow("port_b_union_screw", "Screw-05")
elseif port_b_size = 3.00 then
iPart.ChangeRow("port_b_union_screw", "Screw-06")
end If

Port_C_Rule

Copiare il blocco di codice sottostante

i = iPart.FindRow("port_c_union", "port_size", "=", port_c_size)
port_c_y_dist_between_screws = iPart.CurrentRowValue("y_dist_betwn_screw")
port_c_x_dist_between_screws = iPart.CurrentRowValue("x_dist_betwn_screw")

If port_c_size = .50 then
iPart.ChangeRow("port_c_union_screw", "Screw-01")
elseif port_c_size = .75 then
iPart.ChangeRow("port_c_union_screw", "Screw-02")
elseif port_c_size = 1.00 then
iPart.ChangeRow("port_c_union_screw", "Screw-02")
elseif port_c_size = 1.25 then
iPart.ChangeRow("port_c_union_screw", "Screw-03")
elseif port_c_size = 1.50 then
iPart.ChangeRow("port_c_union_screw", "Screw-04")
elseif port_c_size = 2.00 then
iPart.ChangeRow("port_c_union_screw", "Screw-04")
elseif port_c_size = 2.50 then
iPart.ChangeRow("port_c_union_screw", "Screw-05")
elseif port_c_size = 3.00 then
iPart.ChangeRow("port_c_union_screw", "Screw-06")
End If

port_c_union_part_number = iProperties.Value("port_c_union", "Project", "Part Number")

Screw_Part_Number_Rule

Copiare il blocco di codice sottostante

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"

Copiare il blocco di codice sottostante

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"

Copiare il blocco di codice sottostante

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"

Update_Excel_Spreadsheet_Rule

Copiare il blocco di codice sottostante

GoExcel.CellValue("part_number.xls", "Sheet1", "Block_Type") = component_type
GoExcel.CurrentCellValue("Block_Style") = block
GoExcel.CurrentCellValue("Block_Part_Number") = iProperties.Value("manifold_block:1", "Project", "Part Number")

GoExcel.CurrentCellValue("port_a_size") = port_a_size
If block = "tee" Then
GoExcel.CurrentCellValue("port_b_size") = port_b_size
Else
GoExcel.CurrentCellValue("port_b_size") = "N/A"
End If
GoExcel.CurrentCellValue("port_c_size") = port_c_size

GoExcel.CurrentCellValue("block_depth") = Parameter("manifold_block:1", "block_depth")
GoExcel.CurrentCellValue("block_width") = Parameter("manifold_block:1", "block_width")
GoExcel.CurrentCellValue("block_height") = Parameter("manifold_block:1", "block_height")

GoExcel.CurrentCellValue("port_a_union_cap") = port_a_union_part_number
GoExcel.CurrentCellValue("port_a_screw_kit") = port_a_screw_part_number
If block = "tee" Then
GoExcel.CurrentCellValue("port_b_union_cap") = port_b_union_part_number
GoExcel.CurrentCellValue("port_b_screw_kit") = port_b_screw_part_number
Else
GoExcel.CurrentCellValue("port_b_union_cap") = "N/A"
GoExcel.CurrentCellValue("port_b_screw_kit") = "N/A"
End If
GoExcel.CurrentCellValue("port_c_union_cap") = port_c_union_part_number
GoExcel.CurrentCellValue("port_c_screw_kit") = port_c_screw_part_number

GoExcel.Save

Indietro