Hi,
I'd like to create a collector that contains all the 3d views of my project.
I've tested this collector :
FilteredElementCollector viewCollector = new FilteredElementCollector(doc).OfClass(typeof(View3D)); viewCollector.OfClass(typeof(Autodesk.Revit.DB.View));
but it contains 3d templates too..
How can I get rid of ?
Thanks for your help !
Solved! Go to Solution.
Here you go.
FilteredElementCollector viewCollector = new FilteredElementCollector(doc).OfClass(typeof(View3D));
List<View3D> view3dList = viewCollector.ToElements().Cast<View3D>().Where(x => x.IsTemplate == false).ToList();
Do you have an idea how to execute this in python?
I've tried:
collector = FilteredElementCollector(doc).OfClass(View3D)
view3D = collector.ToElements().Where(lambda x: x.IsTemplate == false).ToList()
but for some reason the collector doesn't recognize
.Where()
Thanks
You should try:
view_3d_collector = FilteredElementCollector(doc).OfClass(View3D).ToElements()
view_3d = [view for view in view_3d_collector if view.IsTemplate == False]
Can't find what you're looking for? Ask the community or share your knowledge.