Command Line Processing

Models can be opened and processed in a variety of ways via the command line. This can be useful for batch processing multiple models.

 

The command line syntax is:

 

“DesignBuilder” “MyFile” /process=ListOfProcesses

 

Four key points need to be considered when working via the command line:

 

  1. DesignBuilder is the file path and name of the DesignBuilder executable, e.g. “C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe”.
  2. MyFile is the file name and path of the model. It must be surrounded by quotes if it contains any spaces.
  3. There must be a space between MyFile and /process=.
  4. Individual process commands in ListOfProcesses must be separated by a comma.

Available Processes

The table below lists the command line processes that can be executed on an open DesignBuilder model.

 

Command What it does
miGSS Changes the view to the simulation screen
miGHL Changes the view to the Heating Design screen
miGHG Changes the view to the Cooling Design screen
miGDY Changes the view to the Daylighting screen
miGCalculate Changes the view to the SBEM/DSM Calculation screen
miGCFD Changes the view to the CFD screen
miTUpdate Runs the calculation for the current screen
miFExport3TCAsXML Exports the model in XML form
TabChange_n Changes the view to tab n on the current screen. e.g. TabChange_2 on the Daylighting screen will change the view to the Annual daylighting tab
SimStartDate d m Sets start date to the numerically specified day and month. e.g. SimStartDate 4 5 sets the start date to May 4.
SimEndDate d m Sets end date to the numerically specified day and month. e.g. SimEndDate 11 5 sets the start date to May 11
ChangeAttributeValue Attribute Value Changes the value of the specified attribute at building level for the currently selected building. E.g. Attribute is the internal name of the attribute and Value is the new value. e.g. ChangeAttributeValue ZoneMultiplier 2 changes the zone multiplier to 2
ExternalCommand_arg Run an external command with optional arguments
ImportModelData_File path and name Imports the model data stored in the defined. The file must be a csv file previously exported from the model.
ImportLibraryData_File path and name Imports the library data stored in the defined file
NoClose Prevents DesignBuilder from shutting down after all commands have been processed

Example Usage

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\<somepath>\shoebox.dsb" /process=miGSS, miTUpdate

 

Runs an EnergyPlus simulation and closes.

 

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\<somepath>\shoebox.dsb" /process=miGSS, miTUpdate, ExternalCommand_ProcessResults

 

Runs an EnergyPlus simulation, process the results in a custom standalone application called ProcessResults.exe and closes. In this case ProcessResults.exe must be either in the folder from which the command is executed or in a folder referenced by the Windows path list.

 

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\<somepath>\shoebox.dsb" /process= miGHL, miTUpdate, miGHG, miTUpdate, NoClose

 

Runs both Heating Design and Cooling Design calculations, then stops DesignBuilder from closing.

 

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\<somepath>\shoebox.dsb" /process= miGDY, miTUpdate, TabChange_2, miTUpdate

 

Runs both Illuminance and Annual daylighting calculations and closes.

 

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\<somepath>\shoebox.dsb" /process= miGCFD, miTUpdate

 

Runs the CFD simulation and closes. Whether this is simple or advanced CFD simulation depends on the model options previously set in Shoebox.dsb.

Batch Processing

 

A convenient way to process a set of models is to run a script with multiple commands. This allows several models and/or several calculations to be run unsupervised.

 

Scripts can be set up in a number of ways including using Windows batch files and PowerShell and Python scripts.

 

The easiest way to set up a batch process for most users will be through a simple batch file. To do that follow the steps below.

 

1. Set up the DesignBuilder models you wish to simulate with the required model data and calculation options. Close DesignBuilder.

 

2. Create a batch file in a folder that you can easily navigate to from the command line.

a. For example create a folder from the root of C:\ drive called "DBBatch".

b. Create a blank text file in that folder called something like BatchRunDB.bat.

3. Copy the commands that you wish to execute into the batch file using a text editor such as Notepad. For example to run simulations for 3 models called Project1, Project2 and Project3 stored in the default Documents\DesignBuilder Data folder, the contents of the batch file might look something like this:

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\Users\MyUsername\Documents\DesignBuilder Data\Project1.dsb" /process=miGSS, miTUpdate

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\Users\MyUsername\Documents\DesignBuilder Data\Project2.dsb" /process=miGSS, miTUpdate

"C:\Program Files (x86)\DesignBuilder\DesignBuilder.exe" "C:\Users\MyUsername\Documents\DesignBuilder Data\Project3.dsb" /process=miGSS, miTUpdate

The above commands may wrap onto new lines when viewed in your browser, but in the batch file each command should be on 1 line.

 

4. Run the batch file, BatchRunDB.bat, by double-clicking on it in Windows File Explorer, or by typing "BatchRunDB.bat" on the command line and pressing <Enter>

 

5. The batch file will load each model into DesignBuilder in turn and execute the commands requested without any user intervention required. When the commands have all been executed for one model, DesignBuilder will save the model and close, returning control to the batch file.

 

In the above example, Project1.dsb is loaded, a simulation is run and when complete and the results have been loaded to the model the project is saved to disk. Then DesignBuilder closes. The same process is repeated for Project2.dsb and Project3.dsb. Once all commands have been executed the batch process is complete and the requested results will be stored in each of the models.

 

6. To retrieve the simulation results, open the processed dsb files in the usual way.

Tip: If you wish to continue to use your computer while the batch process runs, it can help to minimise the DesignBuilder main window so that it doesn't keep grabbing focus each time a new model is loaded.