I'm trying to get an element set from the active view using a some code from th DevTV tutorials. This works to grab an element set from the entire model:
ElementSet elems = revitApp.Create.NewElementSet();
ElementIterator iter = revitApp.ActiveDocument.Elements;
while (iter.MoveNext())
So I assumed that changing it to
ElementSet elems = revitApp.Create.NewElementSet();
ElementIterator iter = revitApp.ActiveDocument.ActiveView.Elements;
while (iter.MoveNext())
Would allow me to work from the active view element set however, I'm getting the error:
"Cannot implicitly convert type 'Autodesk.Revit.ElementSet' to 'Autodesk.Revit.ElementIterator'"
Any insight into why this happens and what the type difference between the Elements object in ActiveDocument is compared to ActiveView?
TIA,


Reply With Quote