1#Sean Page, 2021
2import clr
3
4clr.AddReference('RevitAPI')
5from Autodesk.Revit.DB import *
6
7clr.AddReference('System')
8from System.Collections.Generic import List
9
10clr.AddReference('RevitNodes')
11import Revit
12clr.ImportExtensions(Revit.Elements)
13
14clr.AddReference('RevitServices')
15import RevitServices
16from RevitServices.Persistence import DocumentManager
17
18doc = DocumentManager.Instance.CurrentDBDocument
19
20Sheets = UnwrapElement(IN[0])
21Names = IN[1]
22Folder = IN[2]
23result = []
24sheets = List[ElementId]()
25
26opts = PDFExportOptions()
27#This will uses the Sheet Size for Paper size, or default to Letter
28opts.PaperFormat = ExportPaperFormat.Default
29for sheet,name in zip(Sheets,Names):
30 opts.FileName = name
31 Sheet = List[ElementId]()
32 Sheet.Add(sheet.Id)
33 result.append(doc.Export(Folder,Sheet,opts))
34
35OUT = result
36