RevitServerAPILib 0.1.10

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

Install-Package RevitServerAPILib -Version 0.1.10
dotnet add package RevitServerAPILib --version 0.1.10
<PackageReference Include="RevitServerAPILib" Version="0.1.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RevitServerAPILib --version 0.1.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Revit Server API Library

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
server.Rename(@"Folder\File.rvt","NewFileName.rvt");

//Lock a model
server.Lock(@"Folder\File.rvt");

//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)
{
    Console.WriteLine("{0}\t{1}\t{2}",model.Name,model.LockState.ToString(),model.ModelSize.ToString());
}

Revit Server API Library

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
server.Rename(@"Folder\File.rvt","NewFileName.rvt");

//Lock a model
server.Lock(@"Folder\File.rvt");

//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)
{
    Console.WriteLine("{0}\t{1}\t{2}",model.Name,model.LockState.ToString(),model.ModelSize.ToString());
}

Release Notes

Replaced logging with LibLog to MinLibLog https://github.com/aireq/MinLibLog

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.1.10 118 6/13/2019
0.1.9 98 6/5/2019
0.1.8 288 7/12/2018
0.1.7 243 7/12/2018
0.1.6 351 3/8/2018
0.1.5 277 3/8/2018
0.1.4 399 1/10/2017
0.1.3 340 11/2/2016
0.1.2 325 10/27/2016
0.1.1 301 10/26/2016
0.1.0 420 10/26/2016