I want to analyze dwg file. Is it possible?
I'm trying to write a some program that could analyze the content of the .dwg file. for example the program could say if a door in a building model could be opened.
I've found this article that explains how to read autoCAD file. also i've seen some program that can open and view .dwg files, but nothing to analyze the content.
I want to know if there is something similar to that, that analyze the content of the .dwg file, and to know if there are SDK that can help me analyze?
You could, but it's not easy.
An AutoCAD .DWG file is basically just geometry (lines and arcs). You may have some well organized files with block, let's say a "Door" block, but it's not 100% confident: for instance, you may have "Door1" and "Out Patio Door" as a block name.
For both cases, the way the main problem is to understand the geometry and interpret somehow. Assuming you can, then you have some options of paths:
To interpret the geometry (with any of the above), the BRep API is the best way to analyze the geometry, like intersection points and other relations. The the blog you'll find some samples around it, but I don't believe there is something on this area. Check this and this.
Finally, as a summary, with .NET you'll need the Autodesk.AutoCAD.DatabaseServices namespace with Line, Arc, BlockReference and the respective IntersectWith methods to do some basic analysis.
Now if you have an AutoCAD Architecture .DWG drawing, it might be easier as some basic objects are available as part of the APIs, like Walls and Doors. I don't believe that's the case, but if so, check at this link.