Autodesk.Forge.DesignAutomation
6.0.2
dotnet add package Autodesk.Forge.DesignAutomation --version 6.0.2
NuGet\Install-Package Autodesk.Forge.DesignAutomation -Version 6.0.2
<PackageReference Include="Autodesk.Forge.DesignAutomation" Version="6.0.2" />
paket add Autodesk.Forge.DesignAutomation --version 6.0.2
#r "nuget: Autodesk.Forge.DesignAutomation, 6.0.2"
// Install Autodesk.Forge.DesignAutomation as a Cake Addin #addin nuget:?package=Autodesk.Forge.DesignAutomation&version=6.0.2 // Install Autodesk.Forge.DesignAutomation as a Cake Tool #tool nuget:?package=Autodesk.Forge.DesignAutomation&version=6.0.2
Autodesk.Forge.DesignAutomation
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
- .NET 8 or later
- A registered app on the Forge Developer Portal.
Dependencies
- Autodesk.Forge.Core assembly which provides services such as:
- Acquisition of 2 legged oauth token (and refreshing it when it expires)
- Preconfigurated resiliency patterns (e.g. retry) using Polly
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:
- By using dependency injection and configuration providers (PREFERRED)
- 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:
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)
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, andz
: 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 | Versions 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. |
-
net8.0
- Autodesk.Forge.Core (>= 4.1.1)
- Newtonsoft.Json (>= 13.0.3)
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
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.2 | 150 | 11/22/2024 |
6.0.1 | 11,070 | 8/14/2024 |
6.0.0 | 3,500 | 6/22/2024 |
5.1.2 | 26,817 | 7/26/2023 |
5.1.1 | 9,940 | 1/5/2023 |
5.1.0 | 17,916 | 4/21/2022 |
5.0.2 | 3,307 | 2/15/2022 |
5.0.1 | 454 | 2/15/2022 |
5.0.0 | 494 | 2/14/2022 |
4.3.1 | 4,241 | 2/9/2022 |
4.3.0 | 475 | 2/7/2022 |
4.2.0 | 6,278 | 8/20/2021 |
4.1.0 | 916 | 7/28/2021 |
4.0.0 | 2,526 | 5/19/2021 |
3.0.6 | 36,598 | 11/10/2020 |
3.0.5 | 19,838 | 10/30/2020 |
3.0.4 | 514 | 10/30/2020 |
3.0.3 | 5,068 | 8/13/2020 |
3.0.2 | 23,418 | 4/1/2020 |
3.0.1 | 1,567 | 12/31/2019 |
3.0.0 | 6,393 | 11/1/2019 |
3.0.0-beta5 | 4,233 | 6/17/2019 |
3.0.0-beta4 | 1,227 | 5/5/2019 |
3.0.0-beta3 | 1,313 | 3/11/2019 |
3.0.0-beta2 | 1,146 | 1/24/2019 |
3.0.0-beta1 | 630 | 1/23/2019 |
For full release notes see https://github.com/Autodesk-Forge/forge-api-dotnet-core/blob/master/CHANGELOG.md