views:

9251

answers:

6

Anyone knows of an open source DWG (autocad drawing) library in C#?

A: 

Hi Mac,

There was at one time an effort to port Art Haas's .dwg parser (from the pythoncad project) to c#. I can't seem to find the link ATM, but it was a few years ago. Creating an open source cross-platform .dwg library is at the top of my list for VectorSection, so let me know what you find out!

Eric Wilhelm
+10  A: 

The major hurdle with the DWG format is that the binary format changes every 3 years - and it is due to change again in March 2009. It is encrypted and the specifications for it are not made public. It is a massively complicated library with many dark alleys unknown to even AutoDesk (they acquired it years ago).

Not open source but the Open Design Alliance ... (from their Web site)...

is a non-profit membership-based consortium of software companies, developers and users committed to promoting the open exchange of CAD data now and in the future. In addition to setting standards for CAD data formats, the ODA also focuses on the practical matter of developing software libraries of exceptional quality that enable ODA members to develop applications capable of reading and writing the popular DWG and DGN CAD file formats.

Cost depends on what you are using the libraries for but the base-level cost for a developer is U$100/year with a U$250 joining fee. Compare that to AutoDesk's RealDWG at $2500/year and $5000 for the 1st year then it's a bargain. The RealDWG licence is per product, by the way. The ODA licenses are a bit more reasonable and also allow you to make more than 1 product on the same license. you can pay for the source code but it costs a bomb - less than developing it yourself though

If you only have 1 product then perhaps RealDWG will suit you but it's Windows only - bonus, it has a .NET API which the ODA are still working on. The ODA products are compiled for a number of operating systems, including Windows (32-bit), SGI, Solaris, Windows (64-bit), Macintosh, HP, Windows CE, Linux, IBM AIX.

I any case that's a massive wheel to reinvent so it's definitely worth paying for one that already turns.

Some 3rd-party libraries exist out there with limited specific API functionality to try searching for those if your needs are very specific.

It is also worth noting that AutoDesk has been in more-or-less continuous litigation with the ODA for years now. If you decide to compete with them then that's another complexity you have to look forward to.

I am also developing a product that talks to DWG files. I'm going the commercial route because the time, expense and hassle involved is utterly uneconomical for me.

CAD bloke
The ODA are slowly introducing a .NET version of DWGdirect. You'd be a brace (wo)man to use it in production in the near future
CAD bloke
CAD bloke
A: 

Hi,
I am trying to create a software in vb.net that can read autocad files and get the dimensions out of it. How can i do that. If anyone can help me it will be very helpful and will really appreciate them Thank you

A: 

@aasishcb

The easiest route is to convert dwg to dxf ascii, it is fairly simple to query ascii dxf.

Keith

keith
A: 

There are no open source solutions, there are a few commercial ones, amongst which one that I have written myself (a .NET component named CadLib): http://www.woutware.com/cadlib.html.

Wout
A: 

did anyone try cadsofttools CAD Import?

http://www.cadsofttools.com http://www.cadsofttools.com/en/products/cad_import_.net.html

Sebastian