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