# Revit Server API Library

- [Bitbucket](
- [NuGet](

A .NET Class library for accessing and manipulating Revit Server through its REST API.

## Usage

The REST API of a Revit Server is accessed by creating an instance of the `RevitServer` class.

    RevitServer server = new RevitServer("HOSTNAME",2015);

Methods on this class can be used to query information from and manipulate the models on the target server.

    //Create a new RevitServer instance
    RevitServerAPILib.RevitServer server = new RevitServerAPILib.RevitServer("HOSTNAME", 2015);
    //Get properties of the server
    var properties = server.GetServerProperties();
    //Rename a model
    //Lock a model
    //List the history of a model
    var history = server.GetModelHistory(@"Folders\File.rvt");
    foreach(var item in history.Items.OrderByDescending(i=>i.VersionNumber))
         Console.WriteLine("{0}\t{1}\t{2}",item.Date.ToString(),item.User, item.Comment);
    //List the models contained by a folder
    var folderContents = server.GetFolderContents(@"Folder\SubFolder");
    foreach (var model in folderContents.Models)