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