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 2.6.1.8850) or in revit 2022.1 (dynamo version 2.1.0.5740).

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
	TransactionManager.Instance.ForceCloseTransaction()
	tGroup = TransactionGroup(doc, "Temp to find crop box element")
	tGroup.Start()
	trans1 = Transaction(doc, "Temp to find crop box element")
	trans1.Start()
	view.CropBoxVisible = False
	trans1.Commit()
	
	shownElems = FilteredElementCollector(doc, view.Id).ToElementIds()
	
	trans1.Start()
	view.CropBoxVisible = True
	trans1.Commit()
	
	cropBoxElement = FilteredElementCollector(doc, view.Id).Excluding(shownElems).FirstElement()
	tGroup.RollBack()
	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
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
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:
	elem.append(GetCropBox(view))
		
OUT = elem

marker

1 Like