Sample Code Revit Batch Processor 1.1.16 documentation
PDFDWGExporterSelectionUI is the sheet selection interface for Revit PDF and DWG batch exports. It lists all sheets in the open document, lets you filter by print set or schedule, select individual sheets for export, choose an export mode (PDF, DWG, or both), and specify the export destination folder.
The main window is divided into the following sections from top to bottom:
Section |
Purpose |
|---|---|
Header banner |
Shows the application title and subtitle |
Message banner |
Displays status messages and validation errors |
Print Set section |
Select and manage named print sets |
Schedule section |
Filter sheets by a Revit schedule |
Sheet selection grid |
Select individual sheets to export |
Export path section |
Specify the destination folder |
Export mode selector |
Choose PDF, DWG, or both |
Export button |
Execute the export and close |
A print set is a named, saved collection of sheets. Selecting a print set auto-ticks only the sheets belonging to that set in the grid below.
Control |
Description |
|---|---|
Print Set dropdown |
Lists all available print sets plus |
Update button |
Replaces the selected print set’s sheet list with the sheets currently ticked in the grid |
Duplicate button |
Opens the Print Set Name dialog to create a copy of the selected print set with a new name |
Delete button |
Marks the selected print set for deletion and resets the dropdown to |
The Update, Duplicate, and Delete buttons are disabled when <None> is selected.
Control |
Description |
|---|---|
Schedule dropdown |
Lists all available Revit schedules plus |
Selecting a schedule and selecting a print set are independent — either can be used to pre-populate the Export checkboxes.
The central grid lists every sheet in the open Revit document.
Column |
Type |
Editable |
Description |
|---|---|---|---|
Export |
Boolean (checkbox) |
Yes |
Tick to include this sheet in the export |
PDF Name |
Text |
No |
Preview of the generated PDF filename based on the current PDF naming settings |
DWG Name |
Text |
No |
Preview of the generated DWG filename based on the current DWG naming settings |
Sheet Number |
Text |
No |
Revit sheet number |
Sheet Name |
Text |
No |
Revit sheet name |
(custom) |
Text |
No |
Additional sheet properties added dynamically from the data source |
Extended multi-select — Shift-click or Ctrl-click to select multiple rows.
Bulk selection — a select-all control in the column header ticks or unticks all visible rows.
Column management — columns can be shown or hidden via the column header menu.
Column visibility preferences are saved and restored between sessions.
Control |
Description |
|---|---|
Export Path text box |
Full path to the folder where exported files will be saved. Type or paste a path, or use Browse |
Browse button |
Opens a folder picker dialog to select the export destination |
Rule |
Behaviour |
|---|---|
Path must not be empty |
Error shown below the text box if blank |
Path must exist on disk |
Error shown below the text box if the folder does not exist |
While any validation error is present, the Export button remains disabled.
A three-position switch controls which file types are generated.
Position |
Label |
Effect |
|---|---|---|
Left |
Export PDF(s) |
Only PDF files are exported |
Centre |
Export DWG(s) |
Only DWG files are exported |
Right |
Export PDF(s) and DWG(s) |
Both PDF and DWG files are exported |
The Export button label updates to reflect the active mode.
The following are saved automatically between sessions:
Setting |
Description |
|---|---|
Last selected print set |
The print set active when the window was closed |
Last selected schedule |
The schedule active when the window was closed |
Export folder path |
The last used export destination |
Export mode |
Whether PDF, DWG, or both was selected |
Column configuration |
Which columns are visible and their order |
Settings are stored in %LocalAppData%\duHast\pdf_dwg_exporter_settings.json.
Open a Revit document and launch the PDF/DWG exporter.
Select a Print Set or Schedule to pre-tick a group of sheets, or tick sheets manually.
Review the PDF Name and DWG Name preview columns to confirm filenames look correct.
Click Browse to set the export destination folder, or type the path directly.
Select the export mode using the three-way switch.
Click the Export button to run the export and close the window.