Document Export(String, IList Element |
Exports a selection of views in PDF format.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

public bool Export(
string folder,
IList<ElementId> viewIds,
PDFExportOptions options
)
Parameters
- folder String
- Output folder, into which file(s) will be exported. The folder must exist.
- viewIds IList ElementId
- Selection of ordered views to be exported. The list must contain at least one valid view.
- options PDFExportOptions
- Various options applicable to the PDF format.
Return Value
BooleanTrue if all specified views are exported successfully, False if exporting of any view fails, even if some views might have been exported successfully.

Exception | Condition |
---|---|
ArgumentException | 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. |
ArgumentNullException | A non-optional argument was null |
FileAccessException | Thrown when the target PDF file is inaccessible, e.g. already opened. |
InvalidOperationException | A PDF Export is already occurring on this document. -or- There are too many PDF Exports in progress (3). -or- A PDF Export cannot occur in the background in a Family document. -or- Export is temporarily disabled. -or- Exporting is not allowed in the current application mode. |
InvalidPathArgumentException | The folder does not exist. |
