Changing BOM Quantity of Components in Assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, took a look around the forums and didn't find a good solution for trying to change the BOM quantity of components. Currently I have parts in folders in an assembly and I loop through the folders to suppress all components and then unsuppress others if they meet the criteria for unsuppression which is whether or not the part number contains a specific size. The suppression/unsuppression is handled by a single function and the function suppresses ~ 20 parts, then unsuppresses 2. What I'd like is if I can access the BOM quantities from the way this is set up -
Overloads function SuppressFolder(uSuppPart as string, suppFolder as string)
Dim oAssDoc As Inventor.AssemblyDocument = ThisDoc.Document
Dim oBrowserFolder As Inventor.BrowserFolder
Dim oBrowserPane As Inventor.BrowserPane = oAssDoc.BrowserPanes.Item("Model")
Dim oFolder As BrowserFolder
Dim size As Integer
oFolder = oBrowserPane.TopNode.BrowserFolders.Item(suppFolder)
oFolderNodes = oFolder.BrowserNode.BrowserNodes
For Each oNode As BrowserNode In oFolderNodes
oComp = oNode.NativeObject
partNo = Left(oComp.Name, Len(oComp.Name)-2)
oComp.Suppress
uSupp = InStr(oComp.Name, uSuppPart, vbTextCompare)
If uSupp <> 0 then oComp.Unsuppress
Any chance it's possible to start setting BOM quantities? Given that there's 2 parts with the same name that'll get unsuppressed, you could pass in a component quantity to the function, and then handle the quantity with something like
If oComp.BomQuantity <> ComponentQuanty then oComp.BomQuantity = ComponentQuantity
Naturally BomQuantity isn't an object but is there any way to write something like that?