1

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

  • 1
    This is very much doable but will require that you learn the AutoCAD API (.net, c++ or lisp). You should build and test your code locally using AutoCAD and when it works you can use the Design Automation API to run your code in the "cloud". "Table" in AutoCAD can be simply lines and text or it can be first class table object. Your solution will look very different depending on whether you need to support all "table like" things or just first class table objects. – Albert Szilvasy Mar 23 '23 at 18:50

1 Answers1

0

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/

Xiaodong Liang
  • 2,051
  • 2
  • 9
  • 14
  • @xiadong appreciate your response. We have experience with .NET design automation API and have created a shared DWG using an AutoCAD plugin, where we created tables around the valve drawing using the Table() method. I was wondering if you could share a reference link or documentation link to a method that can be used to fetch table data from the drawing. Any help would be greatly appreciated. – Ajay Pratap Sing Rao Mar 28 '23 at 11:58
  • to read table data, you could specify the row and colum number in Cells() method. Please check this article https://www.cadtutor.net/forum/topic/40413-autocad-tables-data-extraction/ – Xiaodong Liang Mar 29 '23 at 06:46