Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Supress entire folder. How?

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
achmidt
1825 Views, 14 Replies

Supress entire folder. How?

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

 

 

 

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
14 REPLIES 14
Message 2 of 15
jdkriek
in reply to: achmidt

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
in reply to: jdkriek

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
achmidt
in reply to: achmidt

great script! works !!!

thank you.

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 5 of 15
jdkriek
in reply to: achmidt

Your're quite welcome 😉

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


Message 6 of 15
achmidt
in reply to: jdkriek

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.

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 7 of 15
jdkriek
in reply to: achmidt

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.


Message 8 of 15
Spidermeld
in reply to: jdkriek

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

Thanks
Message 9 of 15
jdkriek
in reply to: Spidermeld


@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
in reply to: jdkriek

Works perfect.  Thank you for the quick response.

Message 11 of 15
jdkriek
in reply to: Spidermeld

You're welcome 😉

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


Message 12 of 15
drichter
in reply to: jdkriek

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

 

Message 13 of 15
skyngu
in reply to: drichter

have you checked code line by line? in most cases, copy and paste from website will mess up the codes.
Autodesk Inventor Professional 2019
Message 14 of 15
davidp
in reply to: achmidt

   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.

Message 15 of 15
Charlies_3D_T
in reply to: jdkriek

@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!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report