Export Method (String, IList(ElementId), PDFExportOptions)


Exports a selection of views in PDF format.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2022

Syntax

C#
public bool Export(
	string folder,
	IList<ElementId> viewIds,
	PDFExportOptions options
)
Visual Basic
Public Function Export ( _
	folder As String, _
	viewIds As IList(Of ElementId), _
	options As PDFExportOptions _
) As Boolean
Visual C++
public:
bool Export(
	String^ folder, 
	IList<ElementId^>^ viewIds, 
	PDFExportOptions^ options
)

Parameters

folder
Type: SystemString
Output folder, into which file(s) will be exported. The folder must exist.
viewIds
Type: System.Collections.GenericIListElementId
Selection of ordered views to be exported. The list must contain at least one valid view.
options
Type: Autodesk.Revit.DBPDFExportOptions
Various options applicable to the PDF format.

Return Value

True if all specified views are exported successfully, False if exporting of any view fails, even if some views might have been exported successfully.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException non empty list of views must be provided. -or- NullOrEmpty -or- There are duplicate views in viewIds -or- some of the views are not printable (exportable). -or- Thrown when one or more input arguments are invalid.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsFileAccessException Thrown when the target PDF file is inaccessible, e.g. already opened.
Autodesk.Revit.ExceptionsInvalidOperationException Export is temporarily disabled. -or- Exporting is not allowed in the current application mode.
Autodesk.Revit.ExceptionsInvalidPathArgumentException The folder does not exist.

See Also