Hiding and showing the right and left Bubble on Level heads in (multiple) views

Knipsel5I want to Hide and show the right en left level check box in (multiple) views

i have seen some similar topic but i can not even get it to work in one view

Knipsel

I get the following warning:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 19, in
TypeError: iteration over non-sequence of type Level

1 Like

First problem solved
i got this python script running :slight_smile:

That Gr8 but How?? could be kind to elaborate

2 Likes

Ok

DY PL Toggle Grid Bubbles (onder en links aan, rechts en boven uit).dyn (10.7 KB)

Sorry wrong one

Here’s the right one
:grinning:

DY PL Levels Hide or Show Bubble Left or Right (checkbox on or of).dyn (6.7 KB)

3 Likes

Ps it depends on how the levels are made in revit. If it turns out the left or right side.

Thanks a lot work like a charm lovely

1 Like

Is it possible to get this to accept lists of levels and views? I dont know python well enough to work it out

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

def tolist(obj1):
    if hasattr(obj1,"__iter__"): return obj1
    else: return [obj1]
    
a = tolist(UnwrapElement(IN[0]))
v = tolist(UnwrapElement(IN[1]))
b = UnwrapElement(IN[2])
TransactionManager.Instance.EnsureInTransaction(doc)

for i in a:
	if b:
		i.ShowBubbleInView(DatumEnds.End0,v)
		i.HideBubbleInView(DatumEnds.End1,v)

	else:
		i.HideBubbleInView(DatumEnds.End0,v)
		i.ShowBubbleInView(DatumEnds.End1,v)

TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.
OUT = 0

does this work for lists of views and levels?

it does work for the selected levels

Cant seem to get it to work for me. I have a bunch of views with one level in them that I want to turn the bubble off on the right side. Is my listing wrong?

DY PL Levels Hide or Show Bubble Left or Right (checkbox on or of).dyn (10.3 KB)
DY PL Toggle Grid Bubbles (onder en links aan, rechts en boven uit).dyn (10.7 KB)
I use these dynamo nodes. I freeze the not required one as needed

Hi Mustafa, can you tell me were the “GetRevitSelection” custom node is available.
Capture
Cheer K

I would also be interested in where to find the “Get Revit Selection” custom node. Graph is erroring out at this node, and I don’t know Python.

Morning Jorge,
I ended up replacing that node with the Springs.Collector.CurrentSelection node which worked.

Thank you @Kai. I’ll try that.

DY PL Levels Hide or Show Bubble Left or Right (checkbox on or of).dyn (18.3 KB)

I tried replacing the custom node, but nothing happened. Can someone check the attached graph and let me know what I’m doing wrong. I am new-ish to Dynamo and new to Python. Any help would be greatly appreciated.

Morning Jorge,
Downloaded your script works on my end see attached vid.
Probably a dumb qs but you are selecting the grids in the view prior to running?
Cheers Kai