Previous Topic

Next Topic

Inhoudsopgave

Book Index

Setting BOM Definitions

Description

With bill of materials (BOM) definitions you define the columns of the BOM on the drawing and in addition, you can fill the BOM for a particular Isah item. The standard Isah CAD application integration takes care of placing the BOM on the drawing. It also possible to write this functionality yourself.

Selecting a BOM Definition

Every combination of CAD application, language and Isah table can have its own BOM definition so the user has to choose a definition with the SelectPartsListDefinition method. If you specify an application code you can limit the definition set in the selection form to the definitions of that application.

The application codes for the supported CAD applications are:

If the user closes the form by clicking OK, the selected definition code will be returned via the DefinitionCode output parameter. The result of the method will be TRUE.

Dim lDefCode As String

Dim oPartsListDef As IPDMLink.PartsListDefinition

lDefCode = “”

If oPDMLink.Utility.SelectPartsListDefinition(lDefCode, "") Then

oPartsListDef = New IPDMLink.PartsListDefinition

oPartsListDef.DefinitionCode = lDefCode

oPartsListDef.Refresh()

MsgBox "Selected definition: " & _

oPartsListDef.DefinitionCode & ", " & oPartsListDef.Description

End If

Reading BOM Values

Based on the PrimKey of the Isah item the values of the BOM cells can be determined for a BOM definition. First, the definition needs to be read, so all columns will be known. After that, the values of each row can be read. All values are available in text format. The separators of integers are based on the system settings. A conversion factor for measurements is set per BOM definition. This enables, for example, the conversion of meters into millimeters when the dimension is saved in the database in meters while it should be displayed in millimeters.

In the following code the Refresh method reads the columns of the BOM definition and after that, the RefreshValues method reads the values in the cells.

Dim oPartsListDef As IPDMLink.PartsListDefinition

Dim i As Integer

oPartsListDef = New IPDMLink.PartsListDefinition

oPartsListDef.DefinitionCode = "ACAD_PART"

oPartsListDef.Refresh()

oPartsListDef.RefreshValues "0"

MsgBox "Number of lines: " & oPartsListDef.RowCount

For i = 0 To oPartsListDef.ColumnCount – 1

MsgBox "Column " & i + 1 & ": " & _

oPartsListDef.Columns(i).Title & " = " & _

oPartsListDef.Rows(0).Values(i)

Next I