<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hide nodes Browserfolder in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-nodes-browserfolder/m-p/6670050#M67790</link>
    <description>&lt;P&gt;Hi All ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about browserfolders in inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code that hide the content (parts / component patterns) of a browserfolder and set &lt;SPAN&gt;bomstructure to reference in this folder&lt;/SPAN&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i want to specify it also for a Sub_Folder in this folder by giving the foldername as a argument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. when its a first level folder &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: hide everything and set bomstructure in this folder (include the child subfolders)&lt;/P&gt;&lt;P&gt;2. When its a second &amp;nbsp;level folder : &lt;SPAN&gt;hide everything and set bomstructure ONLY in this folder&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below the code for case 1 (maby can be better) , cause a subfolder didn't hide&lt;/P&gt;&lt;PRE&gt;	
Private Sub SetFolderVisibility(ByVal FolderName As String, ByVal Visibility As Boolean)
On Error Resume Next

Dim oAssyDoc As Inventor.AssemblyDocument = ThisDoc.Document 
       
oPane = ThisDoc.Document.BrowserPanes("Model")

'Get the browser folder object
oFolder = oPane.TopNode.BrowserFolders.Item(FolderName) 

'Get the set of nodes in the folder
oFolderNodes = oFolder.BrowserNode.BrowserNodes 

'Cycle through each browser node in the folder
	For Each oNode As BrowserNode In oFolderNodes 
	
		oComp = oNode.NativeObject
			
		'set Visibility folder contents		
	If Visibility = True Then
                oComp.BOMStructure = Inventor.BOMStructureEnum.kDefaultBOMStructure
                oComp.Visible = True	
        Else
                oComp.BOMStructure = Inventor.BOMStructureEnum.kReferenceBOMStructure
                oComp.Visible = False		
        End If			   
	Next
	
	
	Dim oOccurrencePattern As Inventor.OccurrencePattern = Nothing
	Dim OccurrencePatternName As String  
	
		
	For Each oOccurrencePattern In oAssyDoc.ComponentDefinition.OccurrencePatterns
		Dim oOccurrencePatternElement As Inventor.OccurrencePatternElement
		For Each oOccurrencePatternElement In oOccurrencePattern.OccurrencePatternElements
			Dim oOcc As Inventor.ComponentOccurrence
			oOcc.Name = OccurrencePatternName
			For Each oOcc In oOccurrencePatternElement.Occurrences
				If oOcc.Visible = True Then
					oOcc.BOMStructure = Inventor.BOMStructureEnum.kDefaultBOMStructure
				Else If oOcc.Visible = False
					oOcc.BOMStructure = Inventor.BOMStructureEnum.kReferenceBOMStructure   
				End If
			Next
		Next
	Next



End Sub	




&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx for helping me&lt;/P&gt;</description>
    <pubDate>Sun, 06 Nov 2016 10:07:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-11-06T10:07:09Z</dc:date>
    <item>
      <title>Hide nodes Browserfolder</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-nodes-browserfolder/m-p/6670050#M67790</link>
      <description>&lt;P&gt;Hi All ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about browserfolders in inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code that hide the content (parts / component patterns) of a browserfolder and set &lt;SPAN&gt;bomstructure to reference in this folder&lt;/SPAN&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i want to specify it also for a Sub_Folder in this folder by giving the foldername as a argument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. when its a first level folder &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: hide everything and set bomstructure in this folder (include the child subfolders)&lt;/P&gt;&lt;P&gt;2. When its a second &amp;nbsp;level folder : &lt;SPAN&gt;hide everything and set bomstructure ONLY in this folder&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below the code for case 1 (maby can be better) , cause a subfolder didn't hide&lt;/P&gt;&lt;PRE&gt;	
Private Sub SetFolderVisibility(ByVal FolderName As String, ByVal Visibility As Boolean)
On Error Resume Next

Dim oAssyDoc As Inventor.AssemblyDocument = ThisDoc.Document 
       
oPane = ThisDoc.Document.BrowserPanes("Model")

'Get the browser folder object
oFolder = oPane.TopNode.BrowserFolders.Item(FolderName) 

'Get the set of nodes in the folder
oFolderNodes = oFolder.BrowserNode.BrowserNodes 

'Cycle through each browser node in the folder
	For Each oNode As BrowserNode In oFolderNodes 
	
		oComp = oNode.NativeObject
			
		'set Visibility folder contents		
	If Visibility = True Then
                oComp.BOMStructure = Inventor.BOMStructureEnum.kDefaultBOMStructure
                oComp.Visible = True	
        Else
                oComp.BOMStructure = Inventor.BOMStructureEnum.kReferenceBOMStructure
                oComp.Visible = False		
        End If			   
	Next
	
	
	Dim oOccurrencePattern As Inventor.OccurrencePattern = Nothing
	Dim OccurrencePatternName As String  
	
		
	For Each oOccurrencePattern In oAssyDoc.ComponentDefinition.OccurrencePatterns
		Dim oOccurrencePatternElement As Inventor.OccurrencePatternElement
		For Each oOccurrencePatternElement In oOccurrencePattern.OccurrencePatternElements
			Dim oOcc As Inventor.ComponentOccurrence
			oOcc.Name = OccurrencePatternName
			For Each oOcc In oOccurrencePatternElement.Occurrences
				If oOcc.Visible = True Then
					oOcc.BOMStructure = Inventor.BOMStructureEnum.kDefaultBOMStructure
				Else If oOcc.Visible = False
					oOcc.BOMStructure = Inventor.BOMStructureEnum.kReferenceBOMStructure   
				End If
			Next
		Next
	Next



End Sub	




&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx for helping me&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 10:07:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-nodes-browserfolder/m-p/6670050#M67790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-06T10:07:09Z</dc:date>
    </item>
  </channel>
</rss>

