이제 부품 번호를 계산하는 모형을 구성하는 데 필요한 모든 매개변수 값을 설정했습니다. 작성한 마지막 규칙은 Excel 스프레드시트로 이 파일과 연관된 부품 번호 및 다른 매개변수 값을 전달합니다. 이러한 부품 번호의 일부는 iPart에 있고 이 규칙은 나사 부품 번호를 생성했습니다.
update_excel_spreadsheet_rule은 규칙 편집 대화상자의 조각 영역에서 Excel 데이터 연결 범주에서 사용할 수 있는 함수 세트를 사용합니다.
이 규칙은 모형 상태에 따라 필수 셀을 채웁니다. 스프레드시트에서 데이터가 전달되는 모든 셀의 이름은 기록된 정보에 해당하는 이름으로 지정됩니다.
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")
이 섹션에서는 이 튜토리얼 프로젝트와 함께 포함된 part_number.xls 스프레드시트 파일을 참조합니다. Block_Type, Block_Style 및 Block_Part_Number 셀의 값을 설정합니다. 첫 번째 두 값은 조립품 매개변수로부터 설정되고 마지막 값은 블록의 부품 번호 iProperty로부터 설정됩니다.
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
엘보우 스타일 복합에 N/A의 자리 표시자 값을 사용하는 방법을 주의해서 살펴봅니다.
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")
이 섹션에서는 manifold_block:1 구성요소를 참조합니다.
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
규칙의 이전 섹션에 있는 port_b_size처럼 Port B와 관련된 값의 조건부 처리를 살펴봅니다.
GoExcel.Save