
You can use the Revit Server command-line lock utility to lock projects on the Revit central server. This is useful for locking models in order to perform scheduled backups.
NOTE: The command-line locking utility only works on the central server.
After Revit Server installation, the RevitServerLock.exe tool is located in C:\Program Files\Autodesk\Revit Server 2011\Program\RevitServerLock.
In order to use the command-line utility, you should be familiar with DOS and understand the structure of command lines.
Examples of Command-Line Lock Usage
NOTE: The use of quotations as shown in the examples below is required.
To lock a folder called "2010 Hospital Project\Building 1":
RevitServerLock -lock -folder "2010 Hospital Project\Building 1"
Or
RevitServerLock -l -f "2010 Hospital Project\Building 1"
To unlock a folder called "2010 Hosptial Project\Building 1":
RevitServerLock -unlock -folder "2010 Hospital Project\Building 1"
To lock a specific Model named "As-Built complex" in a folder called "2010 Hospital Project":
RevitServerLock -lock -model "2010 Hospital Project\As-Built complex.rvt"
Or
RevitServerLock -l -m "2010 Hospital Project\As-Built complex.rvt"
Usage:
RevitServerLock –lock -server
RevitServerLock –lock –folder <path>
RevitServerLock –lock –model <path>
RevitServerLock –unlock -server
RevitServerLock –unlock –folder <path>
RevitServerLock –unlock –model <path>
RevitServerLock –cancelLock -server
RevitServerLock –cancelLock –folder <path>
RevitServerLock –cancelLock –model <path>
RevitServerLock –all
RevitServerLock –verify [-recreate]
| Commands | Result |
| -l, -lock | Lock the specified item. |
| -u, -unlock | Unlock the specified item. |
| -c, -cancelLock | Cancel a lock that is in progress on the specified item. |
| -s, -server | Perform the specified action on the server. |
| -f, -folder <path> | Perform the specified action on the specified folder. |
| -m, -model <path> | Perform the specified action on the specified model. |
| -a, -all | Show all locked items and their status. |
| -v, -verify | Verify if the lock database is healthy. |
| -r, -recreate | Recreate the lock database when it is corrupt. |
| <path> | A folder or model path relative to the Revit Server project directory: C:\ProgramData\Autodesk\Revit Server\Projects |
See also: