Description
The structure of engineering-items resemble the parts structure (Item, Revisions, Revision, Bom, Bom lines). Examples of applying engineering item revisions in this topic are additions to the tasks described in Modifying Parts and Part Revisions.
Selecting BOM lines
The engineering item revision data have to be read before you can display the bill of materials line form. Use the Select method to display the form in which the user can select a bill of materials line. If the user selects a line, the method parameter will return the line id. Based on this id the object can be determined.
"The folowing code displays a bill of materials line form:
Dim oEngItemRev as IPDMLink.EngineeringItemRevision
oEngItemRev = New IPDMLink.EngineeringItemRevision
oEngItemRev.Primkey = "2"
oEngItemRev.Refresh()
If oEngItemRev.IsValid Then
If oEngItemRev.Bom.Select(lBomId) Then
oBomLine = oEngItemRev.Bom.GetBomLine(lBomId)
MsgBox "The selected line is: " & oBomLine.LineNr & _
", " & oBomLine.SubItemRevisionId
End If
End If
Adding a Part Link
You can link part item revisions either to a part or to a production file. With the Engineering Link API you can manage these links.
The following code links a engineering item revision to part 0. The PrimKey value "=2"is just an example.
Dim oEngItemRev as IPDMLink.EngineeringItemRevision
oEngItemRev = New IPDMLink.EngineeringItemRevision
oEngItemRev.Primkey = "2"
oEngItemRev.Refresh()
If oEngItemRev.IsValid Then
oEngItemRev.ItemLinks.Add 12, "0"
End If