Запад помог, скрипт ниже.
# Copyright(c) 2018, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net
import clr
clr.AddReference(“RevitNodes”)
import Revit
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference(“RevitAPI”)
from Autodesk.Revit.DB import *
import sys
pyt_path = r’C:\Program Files (x86)\IronPython 2.7\Lib’
sys.path.append(pyt_path)
try:
errorReport = None
TransactionManager.Instance.EnsureInTransaction(doc)
options = ImageExportOptions()
options.ExportRange = ExportRange.CurrentView
options.ViewName = “Image_” + doc.ActiveView.Name
result = doc.SaveToProjectAsImage(options)
TransactionManager.Instance.TransactionTaskDone()
except:
# if error occurs anywhere in the process catch it
import traceback
errorReport = traceback.format_exc()
# Assign your output to the OUT variable
if None == errorReport:
OUT = result
else:
OUT = errorReport