Hide sections on floorplan

Hi community,

i’m have been bonking my head on this one :face_with_monocle:.

Below i have made a script that is meant to hide all sections on a overviewplan (floorplan) that are not on the same sheet. i also intend to hide the child view and only show parentviews.
Now the filtering to retrieve the views works fine in my opinion but i can’t make the ‘hidde’ happen.

On the forum i have found multiple post about the node View.HideElements but i can’t find this node in my 2021 (revit 2021.1.2) library (dynamo version or in revit 2022.1 (dynamo version

I also tried the archilab node (see screenshot above) but this one does not seems to do the trick.

Big thx in advance :superhero:!!

Hi @AlexanderVandenbergh,

You should hide the section markers, not the section views themselves.
Use the View CropBox node to obtain the section markers elements.

@Alban_de_Chasteigner Great tip this made it work :ok_hand:!

But i’m already looking for an optimalisation:
The GenuisLoci-node also creates the geometrie wich isn’t really necessary.
And this slows the script down alot.

I’ll mark your Answer as a solution and try to simplify the Loci node :slight_smile: .
Also still wondering where the View.HideElements node form OTB version is hiding from me…

Hi @Konrad_K_Sobon,
I see on the forums that u have a solution for my simplification of the Genius Loci node.

But i’m a newbie at programming, i understand your script as is but i don’t really know how to translate it to work with lists of views.
Can u help me on this one?

def GetViewCropBoxElement(view):
	doc = DocumentManager.Instance.CurrentDBDocument
	tGroup = TransactionGroup(doc, "Temp to find crop box element")
	trans1 = Transaction(doc, "Temp to find crop box element")
	view.CropBoxVisible = False
	shownElems = FilteredElementCollector(doc, view.Id).ToElementIds()
	view.CropBoxVisible = True
	cropBoxElement = FilteredElementCollector(doc, view.Id).Excluding(shownElems).FirstElement()
	return cropBoxElement

Is it as ‘simple’ as stating this before the rest of the script?

for each view in views

I also see allot of script where ‘things’ get Unwrapped , this so u get items within the lists themself?
Thx for your advice :slight_smile:

Hi Alexander,

Another way to find the section marker :

import clr
import Autodesk
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

views = UnwrapElement(IN[0]) if isinstance(IN[0],list) else [UnwrapElement(IN[0])]

def GetCropBox(view):
	provider= ParameterValueProvider(ElementId(BuiltInParameter.ID_PARAM))
	rule = FilterElementIdRule(provider, FilterNumericEquals(), view.Id )
	filter= ElementParameterFilter(rule)
	return doc.GetElement(FilteredElementCollector(doc).WherePasses(filter).ToElementIds().Find(lambda x: x.IntegerValue != view.Id.IntegerValue))

elem = []
for view in views:
OUT = elem


1 Like