Skip to content

Autodesk-Forge/design.automation-windows-services-sample

Repository files navigation

Sample of Windows Service by Design Automation API

(Formely AutoCAD I/O)

.net odata ver visual studio License

Description

Windows service sample to plot a drawing placed in a folder to PDF using Design Automation API

Thumbnail

thumbnail

Industry Background

  • an utility to convert AutoCAD drawing to PDF automatically on the background.

Setup

Dependencies

Prerequisites

  1. Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial. Make sure to select the service Design Automation.
  2. Make a note with the credentials (client id and client secret) of the app.
  3. as mentioned in Dependencies, ensure to build the auxiliary library project and get the binary dll.

Running locally

  1. Open the project. Restore the packages of the project by [NuGet](https://www.nuget.org/. The simplest way is
  • VS2012: Projects tab >> Enable NuGet Package Restore. Then right click the project>>"Manage NuGet Packages for Solution" >> "Restore" (top right of dialog)
  • VS2013/VS2015/2017: right click the project>>"Manage NuGet Packages for Solution" >> "Restore" (top right of dialog)
  1. Add other missing references and the library ofdesign.automation-.net-library
  2. In the project settings, provide the following details:
  • Path to a local folder in your system that contains AutoCAD drawings.
  • Design Automation Client Id
  • Design Automation Client Secret
  • Bucket name in your AWS S3 Storage Picture
  1. Open “App.Config” file and provide AWS credentials. This will allow the sample project to access S3 storage in your AWS profile. Picture
  2. Build the sample project
  3. Install the windows service using “installutil” in the command line of Visual Studio. To do this open Visual studio command prompt and run : installutil < path to PlotToPDFService.exe >
  4. Start the windows service. To do this from the Run windows, type services.msc and look for Plot2PDFService and start it. thumbnail
  5. You may need to switch to "[Log on local system account" of the service if you hit an error of "Access Denied". Picture
  6. Copy any drawing to the watched folder (C:\Temp by default). After some time, a PDF of the same name should be available in the watched folder. Picture

Known Issues

  • as of writing, Design Automation of Forge is released with version 2. Odata is used with .NET project. In futher version, OData might not be used.

Further Reading

License

These samples are licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Balaji Ramamoorthy updated by Xiaodong Liang

About

Plot drawing in a folder: Windows service sample to plot a drawing placed in a folder using Design Automation API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages