pyRevit

Code
Library
Create View Sheet
# -*- coding: utf-8 -*-
#โฌ IMPORTS
from Autodesk.Revit.DB import *
#๐ฆ VARIABLES
doc = __revit__.ActiveUIDocument.Document
active_view = doc.ActiveView
active_level = doc.ActiveView.GenLevel
#๐ด ALL TITLE BLOCKS
all_title_blocks = FilteredElementCollector(doc)\
.OfCategory(BuiltInCategory.OST_TitleBlocks)\
.WhereElementIsElementType().ToElements()
if not all_title_blocks:
import sys
print('There are no TitleBlocks in the Project! \nPlease Try Again')
sys.exit()
selected_title_block = all_title_blocks[0]
#๐ฏ Create Drafting View
with Transaction(doc,'Create Drafting') as t:
t.Start()
new_sheet = ViewSheet.Create(doc, selected_title_block.Id)
t.Commit()
__author__ = '๐โโ๏ธ Erik Frits'
โจ๏ธ Happy Coding!
Erik Frits