Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it possible to renumber, in an assembly, only the parts that have Part Structure as Purchased. Starting from 500, let's say. If so, could you please help me?
I have something like this untill now and it renumbers everypart with 500 and so on:
Sub main() Dim doc As AssemblyDocument = ThisDoc.Document Dim oAssyDef As AssemblyComponentDefinition = doc.ComponentDefinition Dim oBOM As BOM = oAssyDef.BOM Dim oBOMView As BOMView = oBOM.BOMViews.Item(1)'Model Data Call IsPurchased(oBOMView.BOMRows, 0) End Sub Sub IsPurchased(Rows As BOMRowsEnumerator, indent As Integer) For Each oBOMRow As BOMRow In Rows If oBOMRow.BOMStructure = 51973 Then Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oBOMView As BOMView = oADoc.ComponentDefinition.BOM.BOMViews(2) oBOMView.Renumber(500, 5) Else If Not oBOMRow.ChildRows Is Nothing Then Call IsPurchased(oBOMRow.ChildRows, indent + 1) End If End If Next End Sub
Solved! Go to Solution.