Search code examples
autodesk-forgeautocadautodeskautocad-pluginautodesk-designautomation

Identify And Update Table Records In DWG File | Design Automation API | Autodesk Platform Services API


We want to create an autocad plugin that takes input drawing (dwg file) [![Dwg file with tables][1]][1] , identify the table records in drawing and then update them as per user inputs and save the drawing.

Example : In shared drawing, we want to identify table records, so we can update table columns and row values as per our/any given input.

Please let us know if its possible and how it can be achieved with design automation api or any other autodesk platform servies apis.

Input dwg drawing


Solution

  • As Albert mentioned, this is feasible with Design Automation API, while the first is you have had practice with AutoCAD API.

    In case you have not been familiar with, please check the related materials on ADNOpen: https://www.autodesk.com/developer-network/platform-technologies/autocad I would recommend with .NET API.

    As to the plugin, it depends on the Table in your context is native table (first class table as Albert analyzed), or just line+text (Normally this would be a block with text attributes ). If native table, there are quite a lot of articles on how to update table values. e.g. https://adndevblog.typepad.com/autocad/2012/05/how-to-create-a-table-and-fill-in-its-cells-with-net.html you would design the plugin with inputting values and updating the table.

    After the plugin is tested well on local AutoCAD, create a bundle of Design Automation API. Next create an activity by specifying the command that will be used to update the table. Finally, submit a work item by Design Automation API to run the activity. The workitem will define:

    • where the source DWG (with the table inside) comes from ? i.e. the accessible url of the source dwg.
    • the data of the new values It can be static input parameters, or a file stored on cloud, which will be input with a url like source DWG.
    • the target storage of the updated drawing. It will be also an accessible url.

    When the workitem starts, it will download the source DWG to the cloud engine, get the input values, and use them to run the plugin on the engine. After it succeeds, the output drawing will be available for check.

    The basic workflow of Design Automation of AutoCAD can be found at https://aps.autodesk.com/en/docs/design-automation/v3/tutorials/autocad/ And the tutorial demos a typical web application that works with Design Automation: https://tutorials.autodesk.io/tutorials/design-automation/