Autodesk.Forge.DesignAutomation 6.0.0

dotnet add package Autodesk.Forge.DesignAutomation --version 6.0.0
NuGet\Install-Package Autodesk.Forge.DesignAutomation -Version 6.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Autodesk.Forge.DesignAutomation" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Autodesk.Forge.DesignAutomation --version 6.0.0
#r "nuget: Autodesk.Forge.DesignAutomation, 6.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Autodesk.Forge.DesignAutomation as a Cake Addin
#addin nuget:?package=Autodesk.Forge.DesignAutomation&version=6.0.0

// Install Autodesk.Forge.DesignAutomation as a Cake Tool
#tool nuget:?package=Autodesk.Forge.DesignAutomation&version=6.0.0

Autodesk.Forge.DesignAutomation

Design-Automation SDK .NET BUILD nuget

Overview

.NET SDK for Design Automation v3 API, for more information, please visit official documentation

For clients with straightforward needs one high level API client is provided in DesignAutomationClient. For clients with more varied needs the following low level API classes are provided: ActivitiesApi, AppBundlesApi, EnginesApi, ForgeAppsApi, HealthApi, SharesApi, WorkItemsApi.

Requirements

Dependencies

Changelog

The change log for the SDK can be found here.

Contributions

Contributions are welcome! Please open a Pull Request.

Support

Please ask questions on StackOverflow with tag autodesk-designautomation tag. If it turns out that you may have found a bug, please open an issue

Getting Started

To use the API you must instantiate one of the API classes and configure it with the valid forge credentials. You can do this in 2 ways:

  1. By using dependency injection and configuration providers (PREFERRED)
  2. By directly creating instances of one of API classes and the Autodesk.Forge.Core.ForgeConfiguration class and setting is properites

Configuration

There are 2 classes that you can use to configure the API:

  1. Autodesk.Forge.Core.ForgeConfiguration - Allows the configuration of Forge client credentials and alternative authentication service endpoint (default is https://developer.api.autodesk.com/authentication/v2/token)

  2. Autodesk.Forge.DesignAutomation.Configuration- Allows the configuration of non-default API endpoint (default is https://developer.api.autodesk.com/da/us-east/).

This SDK integrates with the .netcore configuration system. You can configure the above values via any configuration provider (e.g. appsettings.json or environment variables). For example to set the Forge credentials you could define the following environment variables:

Forge__ClientId=<your client id>
Forge__ClientSecret=<your client secret>

or the following in your appsettings.json:

{
    "Forge": {
        "ClientId" : "<your client id>",
        "ClientSecret" : "<your client secret>"
    }
}

or using environment variables with ForgeAlternativeConfigurationExtensions:

FORGE_CLIENT_ID=<your client id>
FORGE_CLIENT_SECRET=<your client secret>

Starting with version 4.3 you can also configure multiple ClientId/ClientSecret pairs as follows:

{
 "Forge": {
   "ClientId": "<default clientId>"
   "ClientSecret" : "<default clientSecret>"
   "Agents": {
     "agent1": {
       "ClientId": "<clientId of agent1>"
       "ClientSecret" : "<clientSecret of agent1>"
     },
      "agent2": {
       "ClientId": "<clientId of agent2>"
       "ClientSecret" : "<clientSecret of agent2>"
     }
   },
   ...
}

These credentials are used when you create a named DesignAutomationClient via DesignAutomationFactory.CreateClient(string name) where name should match the name of the agent in configuration.

Examples

Tutorials

Please visit Learn Forge tutorial.

Using dependency injection

First you must add Autodesk.Forge.DesignAutomation services. This is usually done in ConfigureServices(...) method of your Startup class. More information

NOTE: This example assumes that you are building an Asp.Net Core web api or website. If you want to use dependency injection in a console app then follow this example.

using Autodesk.Forge.DesignAutomation;
using Autodesk.Forge.DesignAutomation.Model;
...
public void ConfigureServices(IServiceCollection services)
{
    services.AddDesignAutomation(this.Configuration);
}

Then you can use any of the API classes or interfaces in a constructor:

using Autodesk.Forge.DesignAutomation;
...
public class SomeApiController : ControllerBase
{
    public SomeApiController(IWorkItemsApi forgeApi)
    {
        //use forgeApi here
    }
By directly creating API objects
using Autodesk.Forge.DesignAutomation;
using System.Net.Http;
using System.Threading.Tasks;
using Autodesk.Forge.Core;

internal class Program
{
    public static void Main(string[] args)
    {
        var service =
            new ForgeService(
                new HttpClient(
                    new ForgeHandler(Microsoft.Extensions.Options.Options.Create(new ForgeConfiguration()
                    {
                        ClientId = "<your client id>",
                        ClientSecret = "<your client secret>"
                    }))
                {
                    InnerHandler = new HttpClientHandler()
                })
            );

        var forgeApi = new WorkItemsApi(service);
    }
}

Versioning

Using Semantic Version scheme following the pattern of x.y.z.:

  • x: MAJOR version when you make incompatible changes,
  • y: MINOR version when you add functionality in a backwards-compatible manner, and
  • z: PATCH version when you make backwards-compatible bug fixes.

Source-code

Generated with swagger-codegen.

Build
dotnet build Autodesk.Forge.DesignAutomation.sln
Test
dotnet test Autodesk.Forge.DesignAutomation.sln

License

This sample is licensed under the terms of the Apache License 2.0. Please see the LICENSE file for full details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Autodesk.Forge.DesignAutomation:

Package Downloads
APSToolkit

The toolkit support imporve process Autodesk Forge Pipeline

ricaun.Autodesk.Forge.Oss.DesignAutomation The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Revit Package ricaun.Autodesk.Forge.Oss.DesignAutomation

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.0 295 6/22/2024
5.1.2 19,218 7/26/2023
5.1.1 8,362 1/5/2023
5.1.0 17,668 4/21/2022
5.0.2 3,273 2/15/2022
5.0.1 426 2/15/2022
5.0.0 452 2/14/2022
4.3.1 4,188 2/9/2022
4.3.0 446 2/7/2022
4.2.0 6,236 8/20/2021
4.1.0 883 7/28/2021
4.0.0 2,478 5/19/2021
3.0.6 35,839 11/10/2020
3.0.5 19,807 10/30/2020
3.0.4 492 10/30/2020
3.0.3 5,019 8/13/2020
3.0.2 22,747 4/1/2020
3.0.1 1,531 12/31/2019
3.0.0 5,811 11/1/2019
3.0.0-beta5 4,156 6/17/2019
3.0.0-beta4 1,154 5/5/2019
3.0.0-beta3 1,279 3/11/2019
3.0.0-beta2 1,104 1/24/2019
3.0.0-beta1 601 1/23/2019