On Error Resume Next If ThisDoc.ActiveModelState = "[Primär]" Then Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oBom As BOM = oDoc.ComponentDefinition.BOM Dim BomStructured As BOMView For Each oBomView As BOMView In oBom.BOMViews If oBomView.ViewType = BOMViewTypeEnum.kStructuredBOMViewType Then BomStructured = oBomView End If Next For i=1 To parameter("ph" & "Count") For k = 1 To BomStructured.BOMRows.Count If BomStructured.BOMRows(k).ComponentDefinitions(1).Document.Displayname = Parameter("phDoc" & i) Then BomStructured.BOMRows(k).ItemNumber = Parameter("phItNr" & i) End If Next Next End if