Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hi @tcaG6GZK 

 

See this updated example.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim oSelected As ObjectCollection
oSelected = ThisApplication.TransientObjects.CreateObjectCollection

For Each oItem In ThisDoc.Document.SelectSet
	If oItem.Type = ObjectTypeEnum.kBrowserFolderObject Then oSelected.Add(oItem)
Next

'Check that at least 1 is selected
If oSelected.Count = 0 Then
	MsgBox("no folder selected", , "iLogic") 
	Exit Sub 'exit rule
End if

oPane = ThisApplication.ActiveDocument.BrowserPanes("Model")

For Each oItem In oSelected
	oFolder = oPane.TopNode.BrowserFolders.Item(oItem.name)
	For Each oNode As BrowserNode In oFolder.BrowserNode.BrowserNodes
		oComp = oNode.NativeObject
		oComp.BOMStructure = BOMStructureEnum.kDefaultBOMStructure 'remove BOMStructure override if present
		oComp.Definition.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure
	Next
Next