Create View: ViewDrafting

# -*- 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_drafting = [vt for vt in view_types if vt.ViewFamily == ViewFamily.Drafting]
view_type_drafting  = view_types_drafting[0]

#🎯 Create Drafting View
with Transaction(doc,'Create Drafting') as t:
    t.Start()

    view =  ViewDrafting.Create(doc, view_type_drafting.Id)
    t.Commit()

__author__ = '🙋‍♂️ Erik Frits'

⌨️ Happy Coding!
Erik Frits