Sample Code Revit Batch Processor 1.1.16 documentation
SelectFiles is an IronPython/WPF tool for choosing which Revit (.rvt) files to include in a batch processing run. It presents a filterable list of files found in a source directory and returns the user’s selection to the calling batch process.
The window is divided into three sections from top to bottom:
Section |
Purpose |
|---|---|
Settings expander |
Configure the source directory and search options |
Files section |
Browse, filter, and select Revit files |
Action buttons |
Confirm or cancel the selection |
The Settings expander is collapsed by default. Click the header to expand it and reveal the path and search configuration fields.
Field |
Editable |
Description |
|---|---|---|
Source Path |
Yes |
Directory to search for Revit files. Type a path directly or update via the calling script |
Destination Path |
No |
Output directory for batch task files — set by the calling process |
File Type |
No |
File extension being searched (e.g., |
Number of Files |
No |
Number of task files to generate — set by the calling process |
Incl Sub Dirs |
Yes (checkbox) |
When ticked, the search includes all subdirectories of the source path |
Note: Destination Path, File Type, and Number of Files are read-only and are passed in by the launching script (
startUI.ps1or equivalent). Only Source Path and the subdirectory checkbox are user-editable.
The files section is always expanded and shows the results of the directory search.
A text box at the top of the section lets you narrow the list by file name.
Control |
Description |
|---|---|
File Name Filter text box |
Type one or more terms to filter the file list |
AND radio button |
All terms must be present in the file name |
OR radio button |
Any term is sufficient for a match |
Terms are space-separated. For example, entering hospital level with AND shows only files whose names contain both words; with OR it shows files containing either word.
The data grid below the filter shows all files matching the current filter.
Column |
Description |
|---|---|
File |
File name of the Revit file found in the source directory |
Multi-select — hold Shift or Ctrl and click to select multiple files.
Rows are highlighted when selected. The selection is reflected in the is_selected binding on each row.
Alternating rows use a light background to aid readability.
The batch processing script launches SelectFiles, passing the source directory, destination, file type, and task file count as arguments.
The window opens with the Files section expanded showing all .rvt files found.
Optionally expand Settings and tick Incl Sub Dirs to include files from subdirectories.
Type in the File Name Filter box to narrow the list. Use AND / OR to control how multiple terms are combined.
Select one or more files in the list (Ctrl-click or Shift-click for multiple).
Click OK to confirm. The selected files are returned to the batch process.