Get the suppressed state of a browserfolder (iLogic)

Get the suppressed state of a browserfolder (iLogic)

loicLPQZG
Contributor Contributor
166 Views
1 Reply
Message 1 of 2

Get the suppressed state of a browserfolder (iLogic)

loicLPQZG
Contributor
Contributor

Hi All,

 

I need to manage the suppression states of alot of parts and folders in an assembly.

 

Now i use addapted code from manufacturing DevBlog

https://adndevblog.typepad.com/manufacturing/2015/05/suppress-folder-in-assembly.html

 

This works but with 60000+ parts and multiple folders it takes a long time to itterate through all.

 

The rule above suppresses every seperate occurence in a folder (+100occs) even tho i could suppress the entire folder

 

the following snippet is much faster in suppressing entire folders:

oDoc.SelectSet.Select(oBFolder)
		ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyCompSuppressionCtxCmd").Execute

The problem with this is that I am not able to get the suppression state of the folder before toggeling it.

So if i need it suppressed and it is allready suppressed i can not check the status befor toggeling it.

Is it possible to get the folder suppression state in some way as it is shown in the Rightclick menu.

loicLPQZG_0-1735049749042.png

 

(the isActive part for BOM is not an issue in this situation)

 

Any leads would be greatly appreciated.

0 Likes
167 Views
1 Reply
Reply (1)
Message 2 of 2

C_Haines_ENG
Collaborator
Collaborator

A very similar topic was started on this exact problem a day or two ago. doesn't look like its possible past cycling through each object in the folder and checking if they are all suppressed.

 

 

Sub Main

	Dim oAsm As AssemblyDocument = ThisDoc.Document
	Dim BrowserPane As BrowserPane = oAsm.BrowserPanes.Item("Model")

	For Each oFolder As BrowserFolder In BrowserPane.TopNode.BrowserFolders	
		
		Dim bSuppressed As Boolean = True
		
		For Each oPart In oFolder.BrowserNode.BrowserNodes
			
			If oPart.NativeObject.Suppressed = False
				bSuppressed = False
                Exit For
			End If
				
		Next
		
		MsgBox(oFolder.BrowserNode.BrowserNodeDefinition.Label & " Are all Suppressed? " & vbLf & vbLf & bSuppressed)
		
	Next


End Sub

 

 

0 Likes