이제 이 튜토리얼의 초반부에 언급된 마지막 항목 두 개에 대해 설명하겠습니다.
iLogic에는 Excel 스프레드시트의 정보를 읽을 수 있는 기능이 내장되어 있습니다. 이러한 기능은 시스템 탭의 조각 영역에서 Excel 데이터 연결 노드를 확장하여 사용할 수 있습니다.
이 레슨에서는 지정된 크기에 따라 포트 형상을 제어하는 매개변수 값을 설정하기 위해, 포함된 Excel 스프레드시트 값을 사용하는 규칙을 작성합니다. 규칙은 스프레드시트에서 포트 크기를 검색하여 값 행을 식별합니다. 그런 다음 해당 행의 필드를 읽어 적절한 매개변수 값을 가져옵니다.
T자형 블록에는 포트가 세 개 포함되어 있습니다. 매개변수 대화상자에 각 포트가 나열됩니다. 그러나 매개변수 대화상자에서 포트 크기를 변경해도 모형의 포트 크기가 변경되지 않습니다. 다른 포트 크기를 구동하기 위한 규칙을 추가해야 합니다.
첫 번째 단계로, 포트 크기를 설정하고 각 포트 주변의 나사 패턴 치수를 설정하는 규칙을 추가합니다. 나사 패턴은 조립품에서 플랜지를 블록에 고정하는 데 사용됩니다.
가장 먼저 규칙을 통해, 포트 A에 사용할 값이 포함된 스프레드시트 행을 찾습니다. port_size 열에서 port_a_size 매개변수에 해당하는 값을 검색합니다.
i = GoExcel.FindRow(“3rd Party:Embedding 1”, “Sheet1”, “columnName”, “<=”, 0.2)
i = GoExcel.FindRow("3rd Party:Embedding 1", "Sheet1", "port_size", "=", port_a_size)
이 코드는 포함된 스프레드시트에서 port_a_size 매개변수 값과 동일한 port_size 열이 있는 행을 찾고자 한다는 정보를 나타냅니다.
i = GoExcel.CurrentRowValue("columnName")
여기 표시된 것과 같이 조각의 복사본을 편집합니다.
port_a_y_dist_between_screw = GoExcel.CurrentRowValue("y_dist_between_screw") port_a_x_dist_between_screw = GoExcel.CurrentRowValue("x_dist_between_screw") port_a_port_dia = GoExcel.CurrentRowValue("port_dia") Port_A_Drill_Depth = GoExcel.CurrentRowValue("tap_drill_depth")
Feature.ThreadDesignation("featurename") = “3/8-16 UNC”
여기에 나타난 것처럼 텍스트를 수정합니다.
Feature.ThreadDesignation("Port_A_Threads") = GoExcel.CurrentRowValue("tap_dim")
볼트 구멍에 대한 스레드 지정을 가져올 경우 tap_dim 셀을 사용하도록 지정했습니다.
i = GoExcel.FindRow("3rd Party:Embedding 1", "Sheet1", "port_size", "=", port_a_size) port_a_y_dist_between_screw = GoExcel.CurrentRowValue("y_dist_between_screw") port_a_x_dist_between_screw = GoExcel.CurrentRowValue("x_dist_between_screw") port_a_port_dia = GoExcel.CurrentRowValue("port_dia") Port_A_Drill_Depth = GoExcel.CurrentRowValue("tap_drill_depth") Feature.ThreadDesignation("Port_A_Threads") = GoExcel.CurrentRowValue("tap_dim") i = GoExcel.FindRow("3rd Party:Embedding 1", "Sheet1", "port_size", "=", port_b_size) port_b_y_dist_between_screw = GoExcel.CurrentRowValue("y_dist_between_screw") port_b_x_dist_between_screw = GoExcel.CurrentRowValue("x_dist_between_screw") port_b_port_dia = GoExcel.CurrentRowValue("port_dia") Port_B_Drill_Depth = GoExcel.CurrentRowValue("tap_drill_depth") Feature.ThreadDesignation("Port_B_Threads") = GoExcel.CurrentRowValue("tap_dim") i = GoExcel.FindRow("3rd Party:Embedding 1", "Sheet1", "port_size", "=", port_c_size) port_c_y_dist_between_screw = GoExcel.CurrentRowValue("y_dist_between_screw") port_c_x_dist_between_screw = GoExcel.CurrentRowValue("x_dist_between_screw") port_c_port_dia = GoExcel.CurrentRowValue("port_dia") Port_C_Drill_Depth = GoExcel.CurrentRowValue("tap_drill_depth") Feature.ThreadDesignation("Port_C_Threads") = GoExcel.CurrentRowValue("tap_dim")