Question

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?

Was it helpful?

Solution 2

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 :/

OTHER TIPS

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...
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top