"import clr
clr.AddReference('RevitAPI')
clr.AddReference('System')
clr.AddReference('RevitNodes')
clr.AddReference('RevitServices')
import Revit
import RevitServices
from Autodesk.Revit.DB import *
from System.Collections.Generic import List
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
#Functions for list handling
def ProcessList(_func, _list):
return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list )
#Preparing input from dynamo to revit
def ToRevit(item):
return item.ToRevitType(True)
if IN[1]==True:
if isinstance(IN[0], list):
bblist = ProcessList(ToRevit, IN[0])
else:
bblist = [ToRevit(IN[0])]
else: OUT = 'Change Toggle to True'
def collectElementsInBB(bb):
outline = Outline(bb.Min, bb.Max)
filter = BoundingBoxIntersectsFilter(outline)
collector = FilteredElementCollector(doc, doc.ActiveView.Id).WherePasses(filter)
return [e.ToDSType(True) for e in collector]
OUT = ProcessList(collectElementsInBB, bblist)";
Can someone point me out what is wrong with the script. I am just trying to get a conditional out-put from the script. It will wait until the Toggle value turns true.
[/quote]