- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Guys
Since we are switching to VAULT soon, we need to change the BOM structure of many components. The best way to do this is with iLogic i asume.
We have in our assemblies the purchased parts in the structure tree stored in folders - now an iLogic rule should be created, which changes the content of a certain folder - best ask for the folder name with a query-box - from "standard" to "purchase".
Can someone create me such a rule???
thank you very much!!!
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @tcaG6GZK,
Something like this should work:
oPane = ThisApplication.ActiveDocument.BrowserPanes("Model")
oFolder = oPane.TopNode.BrowserFolders.Item("My_Folder")
'look at each item in the folder
For Each oNode As BrowserNode In oFolder.BrowserNode.BrowserNodes
oComp = oNode.NativeObject
oComp.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure
Next
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Curtis
I´m sorry -but that does not work - there is an error message
but i cant declare the name of the folder in the routine - so there should be a different way to do the job
thx anyway!!
cheers
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @tcaG6GZK ,
See this updated example. This will cycle through all of the browser folders, strip off BOM structure overrides, and set the component BOM structure to Purchased.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
oPane = ThisApplication.ActiveDocument.BrowserPanes("Model") For Each oFolder In oPane.TopNode.BrowserFolders 'look at each item in the folder 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Curtis
it works so far!! thx a lot.
But as i said - it needs to be done on specific folders, not on every folder.
Is it possible to choose a folder by mousclick and then start the routine??
thx in advance
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report