Reputation: 932
I am kinda new to Revit both the software and the programming. I think the whole API and proprieties are real non-instinctive mazes. I searched for quite a time, I found out how to get the current view or how to add a view, but I am unable to get the list of all the views in a project.
Anybody could point me out which API are needed?
Upvotes: 2
Views: 6326
Reputation: 2888
I've been able to do this for Revit 2012 using the FilteredElementCollector. Here's what I have working based on this example (http://thebuildingcoder.typepad.com/blog/2010/04/filter-for-views-and-istemplate-predicate.html):
UIApplication application = commandData.Application;
Document document = application.ActiveUIDocument.Document;
FilteredElementCollector viewCollector = new FilteredElementCollector(document);
viewCollector.OfClass(typeof(View));
foreach (Element viewElement in viewCollector)
{
View view = (View)viewElement;
//Do something...
}
Upvotes: 4
Reputation: 932
Well, it seems it is not implemented yet. I found some kind of hack-way to do it (via print sheet), but it consume a lot of paper. Will have to wait for Revit 2012 :/
Upvotes: 1