Supress entire folder. How?

Supress entire folder. How?

Anonymous
Not applicable
2,373 Views
14 Replies
Message 1 of 15

Supress entire folder. How?

Anonymous
Not applicable

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

 

 

 

0 Likes
Accepted solutions (1)
2,374 Views
14 Replies
Replies (14)
Message 2 of 15

jdkriek
Advisor
Advisor

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)

 

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 3 of 15

jdkriek
Advisor
Advisor
Accepted solution

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)

 

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 4 of 15

Anonymous
Not applicable

great script! works !!!

thank you.

0 Likes
Message 5 of 15

jdkriek
Advisor
Advisor

Your're quite welcome 😉

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 6 of 15

Anonymous
Not applicable

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.

0 Likes
Message 7 of 15

jdkriek
Advisor
Advisor

Concerning your question above, I've responded in your orginal thread.

 

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/placing-part-assembly-from-the-Vault-o...

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 8 of 15

Spidermeld
Participant
Participant
How could I modify this code to suppress all folders in an assembly?

Thanks
0 Likes
Message 9 of 15

jdkriek
Advisor
Advisor

@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
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 10 of 15

Spidermeld
Participant
Participant

Works perfect.  Thank you for the quick response.

0 Likes
Message 11 of 15

jdkriek
Advisor
Advisor

You're welcome 😉

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 12 of 15

drichter
Contributor
Contributor

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

 

0 Likes
Message 13 of 15

skyngu
Collaborator
Collaborator
have you checked code line by line? in most cases, copy and paste from website will mess up the codes.
Autodesk Inventor Professional 2019
0 Likes
Message 14 of 15

Anonymous
Not applicable

   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.

0 Likes
Message 15 of 15

Charlies_3D_T
Advocate
Advocate

@jdkriek 

 

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!

0 Likes