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


Exports a selection of views in PDF format.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.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: System String
Output folder, into which file(s) will be exported. The folder must exist.
viewIds
Type: System.Collections.Generic IList ElementId
Selection of ordered views to be exported. The list must contain at least one valid view.
options
Type: Autodesk.Revit.DB PDFExportOptions
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

Exception Condition
Autodesk.Revit.Exceptions ArgumentException non empty list of views must be provided. -or- NullOrEmpty -or- There comes duplicated views in viewIds -or- some of the views are not printable (exportable). -or- Thrown when one or more input arguments are invalid.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions FileAccessException Thrown when the target PDF file is inaccessible, e.g. already opened.
Autodesk.Revit.Exceptions InvalidOperationException Export is temporarily disabled. -or- Exporting is not allowed in the current application mode.
Autodesk.Revit.Exceptions InvalidPathArgumentException The folder does not exist.

See Also