- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an assembly of a screw conveyor. Our drafting department wants the first line of the bom to be the Entire assembly as a virtual component, renamed to Item A and renumber the remaining lines starting at Item 2 sequentially starting with item number 1. I'm not sure of a couple of arguments needed for the methods (see attachment).
here is the code
// add the virtual components to the list
AssemblyDocument oDoc = (AssemblyDocument)oInventorApp.ActiveDocument;
AssemblyComponentDefinition oCompDef = oDoc.ComponentDefinition;
Matrix oMatrix = oInventorApp.TransientGeometry.CreateMatrix();
ComponentOccurrence oNewOcc = oCompDef.Occurrences.AddVirtual("SC-18", oMatrix);
VirtualComponentDefinition oVurtCompDef = (VirtualComponentDefinition)oNewOcc.Definition;
oVurtCompDef.PropertySets["Design Tracking Properties"]["Description"].Value = "MTO Screw Conveyor";
BOM oBOMDef = oDoc.ComponentDefinition.BOM;
oBOMDef.StructuredViewFirstLevelOnly = true;
oBOMDef.StructuredViewEnabled = true;
oBOMDef.SetPartNumberMergeSettings(false);
BOMView oView = oBOMDef.BOMViews["Structured"];
oView.Renumber(1, 1, );
oDoc.Save();
oDoc.Close();
Solved! Go to Solution.