Starting SAP2000 from the Command Line

It is possible to start SAP2000 from the command line.  The full command line includes the path to the SAP2000.exe program, the path to a SAP2000 data file plus four optional switches that control what happens in the program after the data file ha been opened.  An example of a full command line, including all possible switches, is as follows:

C:\SAP2000\SAP2000.EXE  C:\DATA\MYMODEL.SDB  /R  /D SCAO  /C  /K AO

Following are explanations of each of the items in the example command line:

Command Line Item

Description

C:\SAP2000\SAP2000.EXE

The path to the SAP2000.exe program.

C:\DATA\MYMODEL.SDB

The path to the SAP2000 data file.

This item may have an extension of SDB, MDB, XLS, $2K or S2K.  If the extension is SDB, the file is assumed to be a SAP2000 SDB file and the program will attempt to open it.  If the extension is MDB, the file is assumed to be a Microsoft Access file and the program will attempt to import it.  If the extension is XLS, the file is assumed to be a Microsoft Excel file and the program will attempt to import it.  If the extension is $2K or S2K, the file is assumed to be a SAP2000 text file and the program will attempt to import it.

/R Pn Sn Bn

The /R switch runs the analysis automatically after the data file has been successfully opened or imported.

The /R switch may be followed by Pn where n is 1 or 2. P1 forces the analysis to be run in the same process as SAP2000. P2 forces the analysis to run in a separate process from SAP2000.

The /R switch also may be followed by Sn where n is 1,  2, or 3. S1 forces the analysis to use the standard solver. S2 forces the analysis to use the advanced solver. S3 forces the analysis to use the multi-threaded solver.

The /R switch also may be followed by Bn where n is 1 or 2. B1 forces the analysis to run as 32-bit, even on 64-bit computers. B2 forces the analysis to run as 64-bit, if possible.

/D  SCAO

The /D switch alone automatically performs all possible types of design after the data file has been opened or imported and analysis results are available.

If the /D switch is followed by S, steel frame design is performed.  If it is followed by C, concrete frame design is performed.  If it is followed by A, aluminum frame design is performed.  If it is followed by O, coldformed frame design is performed.  Specifying /D or / D SCAO starts all possible design.

/C

The /C switch closes SAP2000 after the analysis has been run and design has been completed.

/K  AO

The /K switch alone deletes the files created when the analysis was run.

If the /K switch is followed by A, all analysis files except the log and out files are deleted.  If it is followed by O,  the log and output files are deleted.  Specifying /K or /K AO causes the same files to be deleted. 

The /K switch does not delete the Access database file that may be specified to be automatically saved after the analysis has been completed.

 

When a model is opened (or imported), run and designed from the command line, any Access database file specified to be automatically saved after the analysis has been completed is not saved until both the analysis and design have been completed.  This allows the Access database file to include both analysis and design results.