I wanted to share this quick graph that enables you to export PDF’s in Revit 2022. I can’t believe just how easy it is now.
#Sean Page, 2021
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('System')
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
Sheets = UnwrapElement(IN[0])
Names = IN[1]
Folder = IN[2]
result = []
sheets = List[ElementId]()
opts = PDFExportOptions()
#This will uses the Sheet Size for Paper size, or default to Letter
opts.PaperFormat = ExportPaperFormat.Default
for sheet,name in zip(Sheets,Names):
opts.FileName = name
Sheet = List[ElementId]()
Sheet.Add(sheet.Id)
result.append(doc.Export(Folder,Sheet,opts))
OUT = result
There are several setting you can set with the opts like Unreferenced Views, Blue Callouts etc, you just got to set them, but this basic example just uses the current project settings.
I edited the Python above to include the option for PaperFormat which you can set for Default and it will use the TitleBlock size for sheet size, or defaults to Letter if one isn’t available. You can also use sheet names like ARCH_E1 or ISO_A2 etc.
Here is a better list of the majority of options available.
opts.ColorDepth = ColorDepthType.Color
opts.Combine = False
opts.ExportQuality = PDFExportQualityType.DPI600
opts.HideCropBoundaries = True
#This will use the TitleBlock size to create the sheet size
opts.PaperFormat = ExportPaperFormat.Default
#This will use a specific size for every view exported
opts.PaperFormat = ExportPaperFormat.ARCH_E1
opts.HideReferencePlane = True
opts.HideScopeBoxes = True
opts.HideUnreferencedViewTags = True
opts.MaskCoincidentLines = True
#Don't think of this as a "continue" but rather as a silent mode
opts.StopOnError = True
#Make sure to not use these settings as they don't work if 'Default' size is used above
opts.PaperPlacement = PaperPlacementType.LowerLeft
#Make sure to not use these settings as they don't work if 'Default' size is used above
opts.ZoomType = ZoomType.Zoom
#Make sure to not use these settings as they don't work if 'Default' size is used above
opts.ZoomPercentage = 100
opts.ViewLinksInBlue = False
And update to this is that with Hotfix 2022.0.1 now allows you to set some of these options while using Default for PaperFormat without breaking the method.
[/quote]That looks like a very useful image of how those nodes are used. However, the original image is missing. Anybody got a backup or a new reference to the use of PDFexport.ByViewSheetSetin Orchard?
I believe it is dependent on the other settings you use as well including how you group the sheets and names together. Base on this link, I think in order to use this you have to use the naming rules set up. You can also manipulate these in python / dynamo as well.
is there any solution for revit 2021?
i am trying to export sheets as pdf in black and white except the logos along with file name containing “Sheet name - Revsion - Sheet NUmber”
i have modified the script but shows a error.
could someone help me with its solution? Export PDF Revit.dyn (16.6 KB)