One simple question. How can I make a folder visible or not with iLogic?

This widget could not be displayed.

One simple question. How can I make a folder visible or not with iLogic?

Anonymous
Not applicable

Hello!

 

So I have some parts from an assembly grouped into a folder. How can I make that folder and the parts from that folder visible or not with iLogic?

 

Thank you!

0 Likes
Reply
Accepted solutions (1)
834 Views
5 Replies
Replies (5)

Sergio.D.Suárez
Mentor
Mentor

I have tried this ilogic code and it works. Be sure to place the paths of your files and folders well.
If you see an error, check that you have permission to modify these files and not just read.

 

'File Hidden
IO.File.SetAttributes("C:\Users\Sergio\Desktop\BloquePrint3D.ipt", IO.FileAttributes.Hidden)
'Folder Hidden
IO.File.SetAttributes("C:\Users\Sergio\Desktop\DWG", IO.FileAttributes.Hidden)

 I hope this helps with your problem. Regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes

mcgyvr
Consultant
Consultant

@Anonymous wrote:

One simple question....


Assumptions of simplicity strike again..... or maybe I assumed incorrectly here too..

 

@Sergio.D.Suárez  

I think they meant a model browser folder and the files inside it.. Not Windows files/folders..

 

@Anonymous  You really didn't explain how you want this code to determine which folder it should select but there should be some examples here that get you going..

https://forums.autodesk.com/t5/inventor-customization/ilogic-control-browser-folders/td-p/4644503



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269

Anonymous
Not applicable
Accepted solution

I found after all the solution:

 

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

Select Case folder_visibility

    Case "No"
    
        oFolder = oPane.TopNode.BrowserFolders.Item("New Folder")
        oFolderNodes = oFolder.BrowserNode.BrowserNodes
        For Each oNode As BrowserNode In oFolderNodes
        oComp = oNode.NativeObject
        oComp.Visible = 0
        oComp.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
        Next

    Case "Yes"
    
        oFolder = oPane.TopNode.BrowserFolders.Item("New Folder")
        oFolderNodes = oFolder.BrowserNode.BrowserNodes
        For Each oNode As BrowserNode In oFolderNodes
        oComp = oNode.NativeObject
        oComp.Visible = 1
        oComp.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
        Next

End Select 

 

0 Likes

mcgyvr
Consultant
Consultant

@Anonymous wrote:

I found after all the solution:

 

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

Select Case folder_visibility

    Case "No"
    
        oFolder = oPane.TopNode.BrowserFolders.Item("New Folder")
        oFolderNodes = oFolder.BrowserNode.BrowserNodes
        For Each oNode As BrowserNode In oFolderNodes
        oComp = oNode.NativeObject
        oComp.Visible = 0
        oComp.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
        Next

    Case "Yes"
    
        oFolder = oPane.TopNode.BrowserFolders.Item("New Folder")
        oFolderNodes = oFolder.BrowserNode.BrowserNodes
        For Each oNode As BrowserNode In oFolderNodes
        oComp = oNode.NativeObject
        oComp.Visible = 1
        oComp.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
        Next

End Select 

 


You didn't mention anything about setting the parts to reference bom structure in your original post?



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes

Sergio.D.Suárez
Mentor
Mentor

You're right, I'm sorry I misunderstood the text! Regards 😁


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes