{"id":20382703,"url":"https://github.com/autodesk-forge/design.automation-workflow-winform-sample","last_synced_at":"2025-04-12T09:00:25.422Z","repository":{"id":23216400,"uuid":"26573507","full_name":"Autodesk-Forge/design.automation-workflow-winform-sample","owner":"Autodesk-Forge","description":"Design Automation WinForm application: Perform workflow tasks from the Design Automation API such as creating custom activities, creating AppPackage, submitting work item requests and viewing downloaded results","archived":false,"fork":false,"pushed_at":"2018-10-05T19:58:48.000Z","size":1127,"stargazers_count":9,"open_issues_count":0,"forks_count":8,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-26T04:05:04.685Z","etag":null,"topics":["autocad","csharo","design-automation","winforms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Autodesk-Forge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-13T06:09:56.000Z","updated_at":"2025-03-24T15:30:52.000Z","dependencies_parsed_at":"2022-08-21T22:10:18.848Z","dependency_job_id":null,"html_url":"https://github.com/Autodesk-Forge/design.automation-workflow-winform-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fdesign.automation-workflow-winform-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fdesign.automation-workflow-winform-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fdesign.automation-workflow-winform-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fdesign.automation-workflow-winform-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Autodesk-Forge","download_url":"https://codeload.github.com/Autodesk-Forge/design.automation-workflow-winform-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543857,"owners_count":21121838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocad","csharo","design-automation","winforms"],"created_at":"2024-11-15T02:18:45.067Z","updated_at":"2025-04-12T09:00:25.363Z","avatar_url":"https://github.com/Autodesk-Forge.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Design Automation API - WinForm sample\n===========================\n(Formely AutoCAD I/O)\n\n[![.net](https://img.shields.io/badge/.net-4.5-green.svg)](http://www.microsoft.com/en-us/download/details.aspx?id=30653)\n[![odata](https://img.shields.io/badge/odata-4.0-yellow.svg)](http://www.odata.org/documentation/)\n[![Design Automation](https://img.shields.io/badge/Design%20Automation-v2-green.svg)](http://developer.autodesk.com/)\n[![visual studio](https://img.shields.io/badge/visual%20studio-2015%2F2017-yellowgreen.svg)](https://www.visualstudio.com/)\n[![License](http://img.shields.io/:license-mit-red.svg)](http://opensource.org/licenses/MIT)\n\n## Description\nA C# WinForm application for performing workflow tasks of Design Automation on create custom activities, create AppPackage, submit workitem requests and view downloaded results.\n\n## Thumbnail\n![thumbnail](/thumbnail.png) \n\n## Setup\n\n### Dependencies \n* Download and install [Visual Studio](https://visualstudio.microsoft.com/downloads/). In the latest test, Visual Studio version is 2017.\n* Ensure you have already [AWS account and S3 storage](https://aws.amazon.com/s3/). \n* Get the auxiliary library project [design.automation-.net-library](https://github.com/Autodesk-Forge/design.automation-.net-library)\n\n### Prerequisites\n1. **Forge Account**: Learn how to create a Forge Account, activate subscription and create an app at [this tutorial](http://learnforge.autodesk.io/#/account/). Make sure to select the service **Design Automation**.\n2. Make a note with the credentials (client id and client secret) of the app. \n3. as mentioned in **Dependencies**, ensure to build the auxiliary library project and get the binary dll.\n\n## Running locally  \n\n1. Open the project. Restore the packages of the project by [NuGet](https://www.nuget.org/. The simplest way is\n  * VS2012: Projects tab \u003e\u003e Enable NuGet Package Restore. Then right click the project\u003e\u003e\"Manage NuGet Packages for Solution\" \u003e\u003e \"Restore\" (top right of dialog)\n  * VS2013/VS2015/2017:  right click the project\u003e\u003e\"Manage NuGet Packages for Solution\" \u003e\u003e \"Restore\" (top right of dialog)\n2. Add other missing references and the library of[design.automation-.net-library](https://github.com/Autodesk-Forge/design.automation-.net-library)\n3. In the project settings, provide the following details:\n * Path to a local folder in your system that contains AutoCAD drawings. Put some test drawings in this folder.\n * Design Automation Client Id which is from #1 of **Prerequisites**\n * Design Automation Client Secret which is from #1 of **Prerequisites**\n * Bucket name in your AWS S3 Storage which is from #2 of **Prerequisites**\n  ![Picture](./assets/1.png)\n4. Open “App.Config” file and fill in AWS credentials. This will allow the sample project to access S3 storage in your AWS profile.\n  ![Picture](./assets/2.png)\n5. Build the sample project\n6. Run AutoCADIODemo.exe. the main window to appear. The path to the sample drawings that was provided in the project settings can also be provided by accessing “Settings” button as shown in the below screenshot.\n  ![Picture](./assets/3.png)\n\n## Demonstrations\n\n### Demo 1: Using Shared Design Automation Activity\n-----------------------------------------------------------------------------------------------------------------------------\n * Design Automation provides a Shared activity which is named “PlotToPDF”. This activity is available by default. Choose this activity from the list of activities as shown in the below screenshot.Select any drawing from the list of drawings that appear at the left. \n\n  ![Picture](./assets/4.png)\n\n  The chosen drawing will be uploaded to the S3 storage and a WorkItem will be created based on the selected activity.\nThe WorkItem will be submitted to AutoCAD IO for processing and the result will get displayed in the right pane.\n \n ![Picture](./assets/5.png)\n \n### Demo 2: Creating and using a custom AutoCAD IO Activity \n-----------------------------------------------------------------------------------------------------------------------------\n   To create a custom activity, click on the Activities button as shown in below screenshot and provide the details.\n \n  ![Thumbnail](./assets/6.png)\n \nImportant Note : The script should be implemented such that the result file is named as “result.*”. \nThe result file name can be any name of your choice, AutoCAD IO does not have a restriction on that. \nBut just to make the sample code generic and have it identify the result file automatically from the script, \nthe sample project looks for anything that sounds like result.pdf, Result.dwf, RESULT.DWG etc. So for custom activities \nto work, please ensure that the script saves the result with an appropriate file name as result.dwg, result.pdf, result.dwf etc.\nAfter the custom activity is created, close the Activities dialog.\nThe custom activity should now appear in the list of Activities alongside the shared activity as shown in the below screenshot. \n\n  ![Picture](./assets/7.png)\n \nSelect the custom activity and choose any drawing from the list of drawings just as we did for using a Shared activity.\nThe result of the custom activity will be displayed in the right pane if it is a pdf. For any other outputs such as dwg, dwf, \nthe result file is downloaded to a local path and the path is displayed in the right pane.\n\n### Demo 3: Creating and using a custom Design Automation Activity that is linked to an App Package \n-----------------------------------------------------------------------------------------------------------------------------\n\nCreate a custom crx or .Net plugin (that does not reference acmgd.dll)\nPackage it in AutoCAD Bundle format\nClick on “App Packages” button and provide the details as shown in below screenshot\n \n  ![Picture](./assets/8.png)\n \nTo create a custom activity that links with the custom app package, click on the Activities button as \nshown in below screenshot and provide the details.\n \n  ![Picture](./assets/9.png)\n\nAfter the custom activity is created, close the Activities dialog.\nThe custom activity should now appear in the list of Activities alongside the shared activity as shown in the below screenshot. \n \n  ![Picture](./assets/10.png)\n \nSelect the custom activity and choose any drawing from the list of drawings just as we did for using a Shared activity.\nThe result of the custom activity will be downloaded to a local path and the path is displayed as shown in the below screenshot. \n \n  ![Picture](./assets/11.png)\n \nVerify that the custom command has done its task by opening the downloaded result.\n\n## Known Issues\n* 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. \n\n\n## Further Reading \n* [Design Automation API help](https://forge.autodesk.com/en/docs/design-automation/v2/developers_guide/overview/)\n* [ Intro to Design Automation API Video](https://www.youtube.com/watch?v=GWsJM344CJE\u0026t=107s)\n* [Working with Amazon S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html)\n\n## License\n\nThese samples are licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT). Please see the [LICENSE](LICENSE) file for full details.\n\n## Written by \n\nBalaji Ramamoorthy \nupdated by Xiaodong Liang\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodesk-forge%2Fdesign.automation-workflow-winform-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautodesk-forge%2Fdesign.automation-workflow-winform-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodesk-forge%2Fdesign.automation-workflow-winform-sample/lists"}