Skip to content

Commit

Permalink
Update export.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Feb 1, 2021
1 parent 69b4743 commit 45b9c86
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions revitron/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ def exportSheet(self, sheet, directory, unit, template = False):
import revitron

if revitron.Element(sheet).getClassName() != 'ViewSheet':
print(':face_with_rolling_eyes: Element is not a sheet!')
revitron.Log().warning('Element is not a sheet!')
return False

if not directory:
directory = self.output
revitron.Log().warning('There is no DWG export directory defined!')
sys.exit()

if not template:
template = '{Sheet Number}-{Sheet Name}'
Expand Down Expand Up @@ -96,6 +97,10 @@ def __init__(self, printer, output):
"""
import revitron

if not printer or not output:
revitron.Log().warning('PDF exporter is not configured!')
sys.exit()

self.printer = printer
self.output = output
self.manager = revitron.DOC.PrintManager
Expand Down Expand Up @@ -134,7 +139,7 @@ def printSheet(self, sheet, size, orientation = 'Landscape', directory = False,
import revitron

if revitron.Element(sheet).getClassName() != 'ViewSheet':
print(':face_with_rolling_eyes: Element is not a sheet!')
revitron.Log().warning('Element is not a sheet!')
return False

if not directory:
Expand Down

0 comments on commit 45b9c86

Please sign in to comment.