You can do something like this:
With FilteredElementCollector you get all elements in the (active) view. And with BoundingBoxIsInsideFilter or BoundingBoxIntersectsFilter you can filter out the elements inside the bounding box:
##Python code:
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitNodes')
clr.AddReference('RevitServices')
import Revit
import RevitServices
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
#Preparing input from dynamo to revit
bb = IN[0].ToRevitType()
outline = Outline(bb.Min, bb.Max)
#filter = BoundingBoxIntersectsFilter(outline)
filter = BoundingBoxIsInsideFilter(outline)
collector = FilteredElementCollector(doc, doc.ActiveView.Id).WherePasses(filter)
OUT = [e.ToDSType(True) for e in collector]
##File:
getElementsInBB.dyn (7.8 KB)