Active View with Area Plan


#1

Hello all,

I am trying to gather all grids in the active view (an Area Plan). My script works fine with Floor plans but fails when the Active view is an Area Plan. Anyone have an Idea?

Similar issue:


#2

Originally reported here:


And solved here:

So this should work in Dynamo 2.0 … :slight_smile:


#3

Hi @Steven

Or else you can just write a few lines of python to get it worked in Dynamo1.3.2 :slight_smile:

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager


view = UnwrapElement(IN[0])


doc = DocumentManager.Instance.CurrentDBDocument

coll = FilteredElementCollector(doc, view.Id)
filt = ElementCategoryFilter(BuiltInCategory.OST_Grids)
grids = coll.WherePasses(filt).ToElements()

#Assign your output to the OUT variable
OUT = grids

#4

Thanks Andreas,

I was looking around but could not find anything.


#5

Thanks Kulkul,

That worked perfectly.


#6

@Steven Please mark the post as solved. You’re welcome!


#7

Sorry I thought I clicked it. :slight_smile:


#8

The equivalent node in springs is called “Collector.ElementsInView” :wink: