Hide groups in views

Hello guys,
Due to the fact that groups cannot be hidden in views through a filter we are working in a Dyn graph to hide them. The only node we have found to hide elements in views is from Archilab however it does not work for groups so for the moment we are hiding the group members.


Do you have a better approach to this???
Dyn attached in case you want to have a look.
Hide Model Groups in View.dyn (58.0 KB)

Maybe move the groups to a new workset and hide the workset?

Hi Marcel,

sure, but we would like to avoid managing all this if possible

So, when creating the workset, set to be invisible in all views, then move your groups to it.

Why not use a filter on the elements in the group? Create a parameter which is set to not vary across group instances, write the name of the group type to each element in the group type (via Dynamo of course), and then set a filter for that parameter.

Hi,

In fact, @Konrad_K_Sobon had offered a solution to this before.

It works great for me, i’m adding it down with the reference.

import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

import System
from System import Array
from System.Collections.Generic import *

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

try:
	errorReport = None
	
	TransactionManager.Instance.EnsureInTransaction(doc)
	for e, v in zip(IN[0], IN[1]):
		view = UnwrapElement(v)
		view.IsolateElementsTemporary(UnwrapElement(e).GetMemberIds())
		view.ConvertTemporaryHideIsolateToPermanent()
	TransactionManager.Instance.TransactionTaskDone()
except:
	import traceback
	errorReport = traceback.format_exc()	

if errorReport == None:
	OUT = IN[1]
else:
	OUT = errorReport

Durmus

1 Like

Thanks Jacob,

I like this approach!

Amazing Durmus,

I will test this out!

Thanks!

Hello Durmus,
Not sure what is going on on my end but the python script does not hide the specified model groups in view.


Dyn attached.21_Hide model groups in views on selected sheets_v1.dyn (52.2 KB)