from Autodesk.Revit.DB import *
doc = __revit__.ActiveUIDocument.Document
active_view = doc.ActiveView
active_level = doc.ActiveView.GenLevel
view_types = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
view_types_drafting = [vt for vt in view_types if vt.ViewFamily == ViewFamily.Drafting]
view_type_drafting = view_types_drafting[0]
with Transaction(doc,'Create Drafting') as t:
t.Start()
view = ViewDrafting.Create(doc, view_type_drafting.Id)
t.Commit()
__author__ = '🙋♂️ Erik Frits'