Git Product home page Git Product logo

forge-api-dotnet-oss.design.automation's Introduction

Autodesk.Forge.Oss.DesignAutomation

Visual Studio 2022 Nuke License MIT Build .NET 6.0 Release

PackageReference

<PackageReference Include="ricaun.Autodesk.Forge.Oss.DesignAutomation" Version="*" />

Requirements

Dependencies

Configuration

By default the Forge credentials could be defined with the following environment variables:

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

Custom

You can define a custom header to be sent with each Design Automation requests to the Forge API. The custom header is only enabled if the engine is deprecated.

FORGE_CLIENT_CUSTOM_HEADER_VALUE=<your custom header>

The custom header follow pattern x-my-custom-header: engine value is {0}. (The value {0} is replaced with the engine+version.) The header gonna be x-my-custom-header and the value engine value is Autodesk.Revit+2023 when using the engine Autodesk.Revit+2023.

Samples

This repository contains each sample of the Autodesk Step-by-Step Tutorial.

API Reference

The package use the namespace Autodesk.Forge.Oss.DesignAutomation.

DesignAutomationService

DesignAutomationService class contain the methods to interact with the Oss and Design Automation API. Internaly uses the ParameterArgumentService to convert a class with Attributes to convert in the Activity and WorkItem to send the request to the Design Automation API.

MaxDesignAutomationService

IDesignAutomationService designAutomationService = new MaxDesignAutomationService("AppName")
{
	EngineVersions = new[] { "2021" },
};

AutoCADDesignAutomationService

IDesignAutomationService designAutomationService = new AutoCADDesignAutomationService("AppName")
{
	EngineVersions = new[] { "24" },
};

InventorDesignAutomationService

IDesignAutomationService designAutomationService = new InventorDesignAutomationService("AppName")
{
	EngineVersions = new[] { "2021" },
};

RevitDesignAutomationService

IDesignAutomationService designAutomationService = new RevitDesignAutomationService("AppName")
{
	EngineVersions = new[] { "2021" },
};

Initialize

Initialize AppBundle by creating and uploading the zip file to the Design Automation.

await designAutomationService.Initialize("Path/AppBundle.zip");

Run

Create the Activity and run the WorkItem and wait for the result, use the Parameters class to define the parameters of the Activity and WorkItem.

bool result = await designAutomationService.Run<Parameters>();
bool result = await designAutomationService.Run<Parameters>((parameters) => {});
Parameters parameters;
bool result = await designAutomationService.Run<Parameters>(parameters);

Delete

Delete all the resources created by the Initialize and Run. AppBundle and Activity gonna be deleted if exists.

await designAutomationService.Delete();

Parameters

The Parameters class is used to define the parameters of the Activity and WorkItem using the Attributes.

  • ParameterInputAttribute - Define the input parameter of the Activity and WorkItem.
  • ParameterOutputAttribute - Define the output parameter of the Activity and WorkItem.

ParameterInputAttribute

Base class ParameterActivityAttribute is used to update the Activity before send the request to the Design Automation API.

  • ParameterActivityClearBundleAttribute - Clear the AppBundle before update the Activity.
  • ParameterActivityInputArgumentAttribute - Define the input argument of the Activity.
  • ParameterActivityInputAttribute - Define the input parameter of the Activity.
  • ParameterActivityInputOpenAttribute - Define the input parameter of the Activity with Open file.
  • ParameterActivityLanguageAttribute - Define the language of the Activity.
  • ParameterActivityScriptAttribute - Define the script of the Activity.

ParameterWorkItemAttribute

Base class ParameterWorkItemAttribute is used to update the WorkItem before send the request to the Design Automation API.

  • ParameterWorkItemTimeSecAttribute - Define the timeout of the WorkItem.

License

This project is licensed under the MIT Licence.


Do you like this project? Please star this project on GitHub!

forge-api-dotnet-oss.design.automation's People

Contributors

ricaun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

veabim

forge-api-dotnet-oss.design.automation's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.