10

I am expoloring currently an AutoCAD .NET API to create a dwg files from winform. Is this possible or should I look for another library? Are there any new tutorials of doing so? thanks

Thanks for all your answers .... I will stick with my old DXF implementation, since this is personal project.

Jim
  • 2,760
  • 8
  • 42
  • 66

5 Answers5

5

Here you have exacly how to do it. AutoCad includes an API for doing that. The problem is that you need to have AutoCad in the computer where your application remains.

Jaime Oro
  • 9,899
  • 8
  • 31
  • 39
  • Hi, I already check it out, but it not using AutoCAD .NET API rather an AutoCAD application itself. Is this is an only way? – Jim Feb 16 '11 at 11:18
  • Well, I think that what the AutoCad API does is running AutoCad and allowing to control it from another program. It also allows to run AutoCad in Invisible mode. – Jaime Oro Feb 16 '11 at 11:25
  • So, there is no way to create a Autocad dwg file just using AutoCad API and without AutoCad installed? – Jim Feb 16 '11 at 11:49
  • That would be a DWG API, not an AutoCad API. – Jaime Oro Feb 16 '11 at 12:47
4

I think your only choice if you want DWG is to use OpenDesign. If you don't want to pay what that costs, you can write DXF instead. I have used VectorDraw, which does give a reasonable object model, and can export DXF without any extra component (I think), or use OpenDesign to write DWG.

erikkallen
  • 33,800
  • 13
  • 85
  • 120
  • Bump, I had an impression that AutoCAD .NET API gives that option (to create files). I think I'll stick with my DXF impelementation. – Jim Feb 16 '11 at 12:06
3

Autodesk sell a library called RealDWG which allow you to read and write dwg file with C# without AutoCAD installed. ~ 2500 € / year.

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=770257

You can also use DXF, which is easier to read and write (text file). The reference can be found here : http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=12272454&linkID=10809853

Maxence
  • 12,868
  • 5
  • 57
  • 69
1

As mentioned by others, OpenDesign is one possibility. It is, however, prohibitively expensive for small companies; we have started using CadLib, which is far cheaper and seems to do the trick so far. It writes to DXF or DWG, and has fairly good documentation.

Joel in Gö
  • 7,460
  • 9
  • 47
  • 77
  • Open Design, used internally in your company, is only U$250, then U$100 per year. http://www.opendesign.com/Associate – CAD bloke Feb 24 '11 at 20:40
  • 1
    Used internally yes; not, however, if you use it in an application that you actually want to sell. – Joel in Gö Feb 25 '11 at 15:21
0

If you're planning to create the file without having autocad running, then you CANNOT use the .net API. The use of the .net API basically requires AutoCAD (or the CoreConsole) to be running for it to work. (You can open other databases but you'd be doing it in process from Autocad.

If you don't want it running in process you can use the Interop API.

Or the other alternative is to is to write to a DXF format which can then be imported into AutoCAD (or any other CAD program) which is capable of reading the format.

BenKoshy
  • 33,477
  • 14
  • 111
  • 80