views:

282

answers:

5

Has anybody done anything like that?

I need to import 3d objects, done in either AutoCAD or Solidworks, and draw them into a windows form. I only need the object to be viewed in 3D and moved around - no manipulation required.

I am assuming I will need 2 libraries at least, one for a very simple 3D engine, and one to actually get what I need from the CAD/SW files. Autodesk has a SDK available for developing AutoCAD plugins using .NET, but I am not sure if you can use it the other way around - loading files into the .NET app.

Any help, links, and ideas are appreciated.

+1  A: 

I believe there's an exposed ActiveX control packaged with Design Reviewer that you could embed with some trouble into a .NET app. Apparently, someone is doing it, so it probably works. That control only reads DWF files, though, so the CAD users would either have to publish their files to DWF (least work for you), or you might be able to convert to DWF using the DWF toolkit (not sure - looks like not).

Jesse Millikan
Thanks, I will look into that ActiveX control. DWF should not be a problem as the drawings are supplied by coworkers.
Dinoo
+2  A: 

DXF files were the universal interop file format in the CAD world, last I looked. They are pretty easy to parse, it is a simple text format. And there is lots of info in the file you can simply skip and still get a recognizable model of the original drawing. The R12 format was especially easy.

Although you don't really want to write the code from scratch if you can avoid it. Shop around, there are plenty of programmers that have done this before. Be careful to avoid re-inventing a CAD program.

Hans Passant
Those are just text files then? Didn't know that. That would work perfectly for extracting enough info I need in order to draw a simple model. This was my main problem - getting stuff out of the AutoCAD drawing.I will look around for a parser, maybe something that draws it too.Thanks for the help.
Dinoo
A: 

Have you looked into eDrawings from SolidWorks, I think it is ActiveX and it can open DXF, and SolidWorks model. You can embed it into Winforms.

jimconstable
After further thought I found out I needed just the info from the autocad file, not draw it with a full blown control. Thanks either way.
Dinoo
A: 

If you want to display AutoCAD DWG or DXF files, you can use Autodesk's free DWG Viewer, known as DWG Trueview (http://www.autodesk.com/dwgtrueview)

This can be embedded in a Windows form, as explained here

A more detailed explanation of the steps is here, but it uses AutoCAD as an example, so don't copy & paste verbatim. It shows you how to link the "OPEN" command to a button.

Nick
After further thought I found out I needed just the info from the autocad file, not draw it with a full blown control. Thanks either way!
Dinoo
A: 

You can access vertex information of 3D objects in Solidworks by using tesselation objects. But this is very similar to saving the model as a STL file.

Kayhano