Message 1 of 3
Create Area Plan

Not applicable
10-25-2017
01:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My company made some decisions implement area plans for different Diagrams. I have a similar setup for setting up all the plans for floor and ceiling plans in my model. My code below does appear to work correctly when i try running for area plans. Was there a change for area plans that does not allow me to do this? I have tested this in Revit 2015 and 2018
public void areaplans() { Document doc = this.ActiveUIDocument.Document; using (Transaction t = new Transaction(doc, "Create Views")) { t.Start(); foreach (ViewFamilyType vft in new FilteredElementCollector(doc) .OfClass(typeof(ViewFamilyType)) .Cast<ViewFamilyType>() .Where(q => q.ViewFamily == ViewFamily.AreaPlan)) { foreach (Level level in new FilteredElementCollector(doc) .OfClass(typeof(Level))) { ViewPlan newview = ViewPlan.Create(doc, vft.Id, level.Id); newview.Name = level.Name + "-" + vft.Name; } } t.Commit(); } }
Thanks in Advance