pyRevit

Code
Library
Create ViewPlan (Floor, Ceiling, Area, Structural)
Floor Plan
# -*- coding: utf-8 -*-
#โฌ IMPORTS
from Autodesk.Revit.DB import *
#๐ฆ VARIABLES
doc = __revit__.ActiveUIDocument.Document
active_view = doc.ActiveView
active_level = doc.ActiveView.GenLevel
#๐ด ALL VIEW TYPES
view_types = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
#๐ FILTER VIEW TYPES
view_types_plans = [vt for vt in view_types if vt.ViewFamily == ViewFamily.FloorPlan]
floor_plan_type = view_types_plans[0]
#๐ฏ Create Floor Plan
with Transaction(doc,'Create Floor Plan') as t:
t.Start()
view = ViewPlan.Create(doc, floor_plan_type.Id, active_level.Id)
t.Commit()
__author__ = '๐โโ๏ธ Erik Frits'Ceiling Plan
# -*- coding: utf-8 -*-
#โฌ IMPORTS
from Autodesk.Revit.DB import *
#๐ฆ VARIABLES
doc = __revit__.ActiveUIDocument.Document
active_view = doc.ActiveView
active_level = doc.ActiveView.GenLevel
#๐ด ALL VIEW TYPES
view_types = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
#๐ FILTER VIEW TYPES
view_types_ceil_views = [vt for vt in view_types if vt.ViewFamily == ViewFamily.CeilingPlan]
ceil_plan_type = view_types_ceil_views [0]
#๐ฏ Create Create Ceiling Plan
with Transaction(doc,'Create Ceiling Plan') as t:
t.Start()
view = ViewPlan.Create(doc, ceil_plan_type.Id, active_level.Id)
t.Commit()
__author__ = '๐โโ๏ธ Erik Frits'Area Plan
# -*- coding: utf-8 -*-
#โฌ IMPORTS
from Autodesk.Revit.DB import *
#๐ฆ VARIABLES
doc = __revit__.ActiveUIDocument.Document
active_view = doc.ActiveView
active_level = doc.ActiveView.GenLevel
#๐ด ALL VIEW TYPES
view_types = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
#๐ FILTER VIEW TYPES
view_types_area = [vt for vt in view_types if vt.ViewFamily == ViewFamily.AreaPlan]
area_plan_type = view_types_area[0]
#๐ฏ Create Area Plan
with Transaction(doc,'Create Area Plan') as t:
t.Start()
view = ViewPlan.Create(doc, area_plan_type.Id, active_level.Id)
t.Commit()
__author__ = '๐โโ๏ธ Erik Frits'Structural Plan
# -*- coding: utf-8 -*-
#โฌ IMPORTS
from Autodesk.Revit.DB import *
#๐ฆ VARIABLES
doc = __revit__.ActiveUIDocument.Document
active_view = doc.ActiveView
active_level = doc.ActiveView.GenLevel
#๐ด ALL VIEW TYPES
view_types = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
#๐ FILTER VIEW TYPES
view_types_structural = [vt for vt in view_types if vt.ViewFamily == ViewFamily.StructuralPlan]
struc_plan_type = view_types_structural[0]
#๐ฏ Create Structural Plan
with Transaction(doc,'Create Structural Plan') as t:
t.Start()
view = ViewPlan.Create(doc, struc_plan_type.Id, active_level.Id)
t.Commit()
__author__ = '๐โโ๏ธ Erik Frits'
โจ๏ธ Happy Coding!
Erik Frits