Hello guys! Can someone tell me if it is possible to supress the entire folder in iLogic? Or I have to supress item by item using :
Component.IsActive("EndBeamInsChannel:1")=True
thanks,
Alex
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
Here you go
'J.Kriek 2012 oApp = ThisApplication oDoc = oApp.ActiveDocument Dim folder As BrowserFolder On Error Resume Next folder = oDoc.SelectSet.Item(1) If Err.Number <> 0 Then MsgBox ("Select a browser folder") Exit Sub End If On Error Goto 0 MsgBox (folder.Name & " is selected.") Dim oCommandMgr As CommandManager oCommandMgr = oApp.CommandManager 'Toggle suppress or unsuppress Call oCommandMgr.ControlDefinitions.Item("AssemblyCompSuppressionCtxCmd").Execute2(True)
Here's another script I wrote real quick that doesn't require the user to select the folder manually - you'll need to define it though
'J.Kriek 2012 oApp = ThisApplication oDoc = oApp.ActiveDocument oPane = oDoc.BrowserPanes("Model") oTopNode = oPane.TopNode 'Define which folder to suppress folder = oTopNode.BrowserFolders.Item("test") oSelectSet = oDoc.SelectSet oSelectSet.Clear 'Select the folder automaticly oSelectSet.Select(folder) MsgBox (folder.Name & " is selected.") Dim oCommandMgr As CommandManager oCommandMgr = oApp.CommandManager 'Toggle suppress or unsuppress oCommandMgr.ControlDefinitions.Item("AssemblyCompSuppressionCtxCmd").Execute2(True)
great script! works !!!
thank you.
Jonathan,
do you know by chance how to pull parts from the vault? for example how to do replace or add parts/assemblies to the current assembly from the vault and not from the local HDD?
I`m looking for the answer for a long period of time and seems like no one knows .....
Thanks in advance.
Alex.
Concerning your question above, I've responded in your orginal thread.
@Spidermeld wrote:
How could I modify this code to suppress all folders in an assembly?
Thanks
Here you go. It's the same thing only reiterating over all the folders.
Note: folders cannot be empty
'J.Kriek 2013 'Suppress all browser folders oApp = ThisApplication oDoc = oApp.ActiveDocument oPane = oDoc.BrowserPanes("Model") oTopNode = oPane.TopNode 'Refrence to Folder Enumerator Folders = oTopNode.BrowserFolders i = 0 'Find all folders For Each Folder In Folders i = i + 1 'Define each folder Folder = oTopNode.BrowserFolders.Item(i) oSelectSet = oDoc.SelectSet oSelectSet.Clear 'Select the folder automaticly oSelectSet.Select(Folder) 'MsgBox (Folder.Name & " is selected.") oCommandMgr = oApp.CommandManager 'Toggle suppress or unsuppress oCommandMgr.ControlDefinitions.Item("AssemblyCompSuppressionCtxCmd").Execute2 (True) Next
Trying to teach myself iLogic and create a configurator for my assmebly. We use alot of different hardware configuration in which each one has its own folder in the browser. I was suppressing each component in the folder but had 100's of lines of code for screws within these folders. I tried using the code you graciously provided in Inventor 2013 but get the following error:
"Object of type 'System.UInt32' cannot be converted to type 'Inventor.CommandTypesEnum'.
Changed "Model" to my assembly name which is "dumb" and changed "Test" to my folder name in the browser called "OldFolder".
Any help you could offer would be greatly appriciated
I need an iLogic rule to run at the assembly level to suppress all folders with the name "Suppress".
For example I have a bunch of cabinets I designed and in each cabinet assembly their is a folder called "Suppress" that contains mostly hardware items.
I place a variety of cabinets in a room like uppers, lowers, sink cabinets etc. Well call this "Room1". Each cabinet assembly has a "Suppress" folder that our programmer suppresses before nesting and programming to filter out the hardware items so we don't nest things like hinges and drawer tracks.
What I need is a at the top level assembly of "Room1" that will look at each cabinet assembly and suppress the "Suppress" folder so the programmer doesn't have to suppress each one manually. I also needs to ignore the assembly if the "Suppress" folder is not found as some do not have this folder.
I have tried some of the code you have posted but I cannot get it to work at the "Room1" level.
Thanks in advance.
Hello,
Can i ask you something about this rule?
I want to be able to suppres and unsuppres a folder inside an if rule.
Now your rule is made to toggle on and off. Can you point me in the right direction to define a suppres or unsuppres state for a folder?
Thank you for your answer!