Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have some code that separately works great.
1. Opens each Sub Assemblies and displays them. (1A &1B) remove (2)
2. Sorts Structured BOM and renumbers them. (2) remove (1A&1B)
When I merge them no go. It seems to jump right over 2.
Code is below.
open sub assemble
2A before code (2)
2B After Code (2)
Here is the code.
Dim oDoc As Inventor.Document Dim oRefDoc As Inventor.Document Dim oCompDoc As Inventor.Document oDoc = ThisApplication.ActiveDocument For Each oRefDoc In oDoc.ReferencedDocuments If oRefDoc.IsModifiable Then oCompDoc = ThisApplication.Documents.Open(oRefDoc.FullFileName) If oCompDoc.ReferencedDocuments.Count > 0 Then 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Dim oAsmDoc As AssemblyDocument Dim oAsmCompDef As AssemblyComponentDefinition Dim oBOMView As BOMView oAsmDoc = ThisDoc.Document oAsmCompDef = oAsmDoc.ComponentDefinition oBOMView = oAsmCompDef.BOM.BOMViews.Item("Structured") oBOMView.Sort("BOM Structure", 0, "Subject", 1, "Description", 1) 'oBOMView.Sort("Item", 1) oBOMView.Renumber(300) 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx End If oCompDoc.Close End If Next
Solved! Go to Solution.