I want to get all areas in my model of type XXX

Is there a node/ quick way to get all area instances of type?

Or do I just have to get all elements then filter them?


Imagine a filter after these nodes :smiley:

I added a filter :stuck_out_tongue_closed_eyes:

1 Like

@Alien ,

i also gave up…

1 Like

Hi,

here a solution with Python

import clr
import sys
import System
from System.Collections.Generic import List, IList, Dictionary
clr.AddReference("System.Numerics")
#
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

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


#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

input_areaScheme = UnwrapElement(IN[0])

filterScheme = System.Predicate[System.Object](lambda x : x.AreaScheme.Id == input_areaScheme.Id)
allArea = List[DB.Element](FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Areas).WhereElementIsNotElementType().ToElements()).FindAll(filterScheme)

OUT = allArea  
3 Likes

OMG… I forgot to unwrap again. No wonder I couldn’t get it to work!

I need a big poster behind my desk saying, “UNWRAP”… Although that could look a little strange to other people. :laughing:

1 Like

@Alien ,

Banana :slight_smile:

KR

Andreas

2 Likes

I know why… I just forget :laughing: