I 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
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
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
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?
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