AutoCAD to Blender

Does anyone know a good way to convert AutoCAD 3d models into Blender? I’ve tried with the last version of Blender (2.4) to import a very simple DXF file (a box) but it seems it doesn’t work…

I’m doing architectural visualisation and till now I was doing the 3d modelling in AutoCAD and the renderings in 3dsmax. I’ve just found about Blender and installed it. It seems very nice and I was thinking to switch from 3dsmax to it, but the first condition is to be able to import from AutoCAD at good quality.

Thanks

Search this forum for the word “architecture” and you’ll find many, many posts that address this issue. Search my name, Mzungu, and yellow (all I can think of right now, there are surely others) for posts if that doesn’t turn up. Yellow has a site that has a tut for importing dxf files. Also: use the 3dsout command in AutoCAD to export a 3ds file, tends to work better than dxf.

Currently I export to 3ds then import that into Wings3D. From Wings you can do a little cleanup then export as either nendo or obj format, both of which work with Blender. Nendo is really only useful for smaller meshes and meshes that have been altered in Wings. My company does bridges so I go with obj most of the time. BTW AutoCAD produces some really ugly geometery. All triangles, normals pointing every which way, doubled verts everywhere :eek:

A while ago the guy who wrote SPE released a dxf library in Python. It looked very complete and well made. If someone were interested they could probably write a very nice dxf importer to replace the Blender internal version (which I have never had work). Both Blender and AutoCAD support lines, splines, text, and 3d meshes - so they should interoperate fairly well…

I’ve always looked for this kind of integration but you always get errors when trying to import full dxfs. There are several workarounds; one is to scan your blueprints or export them to an image format you can import in inkscape and follow this tut (very good):
http://www.opendimension.org/ida/inkscape.php
Or, after trying many alternatives I decided to go for the simplest; model my whole stuff in blender with a reference image instead of modeling in another package and importing to blender (also to completely stop using 3dsmax). If you don’t need exact CAD precision but just a good model to take renders from this is a useful method. Otherwise you should try exporting to a format that works fine with blender. Anyway, this is what I’m doing; first you must know your project inside out (heights, sections, measures, etc) or have reference images of everything, but as I’m only using a top blueprint it speeds things up to know everything by heart, so ask for an exported bmp of the plan or once in Autocad, export you plan as .bmp, but before doing so remember to draw a 2x2meter square somewhere. This square will be our scale reference to match a default blender plane with the image. Start blender and add your image as bakcground in the top viewport; add a default plane and check how the 2x2 square looks compared to the blender plane. Scale and move your background image till it matches the blender plane. That’s it! start drawing on top of it :wink: Check this image: (note, this is just WIP of my latest project so everything is still in a basic design state-maquette):
http://afecelis.gdlib.net/Blender/acad2blend01.jpg
The lower left square at 0,0,0 is my default plane matching the one in the bmp.
http://afecelis.gdlib.net/Blender/acad2blend02.jpg
model drawn on top of the bmp. :smiley:

Yeah, its always good practice to remove doubles and recalc normals on them. Also, when exporting 3DS from AutoCAD (3DSOUT command) remember to tweak your FACETRES variable… seems to control how dense the output geometry is (on curved surfaces 'n such.)

More good thots in this thread.

I’ve posted Bob Holcomb’s I/O scripts for 3DS & OBJ here: Bob_Holcomb_IO-OBJ_3DS.zip

They’re not perfect, but work well most of the time.

Oh yes! forgot to mention, download the latest blenderart magazine (#6) which is dedicated to arch visualization and comes with a ton of handy tips:
http://blenderart.org/

I’ve had pretty good success with .dxf import (believe it or not) by working within its limitations. My methods are similiar to what afecilis outlines above, except that I find I can use an imported .dxf as both background image and a place to extract vertices from when extruding to 3D space. Basically, I do this:
-clean up the ACAD file of EVERTHING that isn’t a straight line or simple curve, (blocks, groups, layers, purge purge purge!), and use a script to turn curves into segmented poly’s (LISP routine, google it)
-save down to .dxf ACAD 12
-scale down by 1/12, so blender units are 1BU=1 foot (for my American friends.:rolleyes: ) Scaling down is generally best, since Blender’s defaults are set to a more modest scale than buildings import at.
-Import each file separately
-with each import, select one of the lines, then select the rest (B-key) and hit CTRL-J to create a single object.
-TAB to edit mode, hit W/remove doubles
-repeat for each file (plans, sections, etc)

If you’re used to 3dsMax, you know the rest.

Its labor intensive, but it sounds worse than it is. You’ll see lines out of whack, but usually you can find whole groups of them in one go, and get a pretty good approximation of the file. It isn’t perfect, but it works. (I’m working up a building in my WIP below, the one on hold, with this method. I did the initial construction drawings for the building, and I’ve been using them to export .dxf’s to extrude.)

Thanks for replies.

  1. The problem is that I use AutoCAD 2007, which doesn’t export anymore to 3ds format… The only formats to export are: DWF, WMF, SAT, STL, EPS, DXX and, of course, the native formats (DWG & DXF)

  2. I’ve tried again to import DXF but at least for 3d files it seems it’s not a good ideea… (for example a box from DXF comes as a simple 2 vertex line in Blender)

I wonder if it will be possible in the future to import directly DWG files…

Did you try using ‘AccuTrans 3D’ for conversion?
The dxf-files produced by this program is in most cases o.k. for Blender.
Here’s the link: http://www.micromouse.ca/

Cheers,

Peter

The one to consider, then, would be STL for 3D. (Likely your AutoCAD 3D elements will have to be ACIS solids, rather than surface/poly -type geometry…) Blender’s STL import has worked okay for me in the past, tho keep an eye on your file names. In the past, when importing an STL, the “current” blender file name changed to match that of the imported geometry. That to say, save before and after attempting this.

Yes, STL works well, but i cannot export more than one object once. So for a normal scene I must do the export/import operation for many many times… :frowning:

Hi all,

The support for CAD format(s) in Blender can be improved or at least a better bridge can be found if people interested on it help the developers. Most Blender devs probably don’t really need this feature and so don’t have enough knowledge and experience with the related programs and workflows, myself included.

But obviously many users need it, so I suggest those who understand this need work on a simple text explaining how you work, what you need, what is currently available for importing / exporting and where things could be improved.

I don’t mean a project to turn Blender into a CAD/CAM app, just the bare minimum to build the bridge you need, at least as a first step with good chances of being implemented. Maybe it will be an import script or updated DXF support or simply finding a good free / open source program to add to your chain.

After a quick search I found these links:

http://lx-viewer.sourceforge.net/

http://www.opendwg.org/

Does this viewer help the linux users? Is it good enough already to load and convert your files?

So… I’ve just discovered Blender and I really am interested in learning it.

I’ll try to explain my actual workflow for architectural visualisation:

  1. I receive 2D drawings in AutoCAD format (DWG), containing the information about the buildings (plans, facades, sections…) - in my area most of the architects use AutoCAD or ArchiCAD as their main CAAD software and that’s why the DWG format is wide spread…

  2. Using the 2d files as support, I build the 3d model of the building (also in AutoCAD), having the layers arranged by material (so all the concrete objects, for example, are in the same layer).

  3. After finishing the modelling I save the file in DWG format. So the result of my work in AutoCAD is a 3d DWG file.

  4. In 3dsMAX I import the DWG file. Here, the import window has some important settings:
    (a) the scale of the DWG file (you can set for example that 1 unit in DWG will be 1 cm in MAX file)
    (b) you can select which layers from the DWG file will be imported and which not
    © other settings related to the quality of the imported 3d objects

  5. After the import operation, the MAX scene objects are set after the DWG layers. So, the _CONCRETE layer from DWG appears as a single object in the MAX scene. This is very important, because you can assign very easy the materials (imagine that I have 50 concrete walls - without this facility I would have to manually assign the concrete materials for 50 objects).

  6. After creating and assigning the materials/textures, I prepare the scene and then render it using VRay render plugin. That’s all…

So, if I want to use Blender in my work the most important think is to be able to import 3d DWG files from AutoCAD, keeping, in a way or another, the objects grouped by material/layer.

Unfortunately I can see that now this is not possible, so I will continue working with 3dsmax for the moment.

I think that I’m not the only one having this kind of workflow and I hope that soon someone could manage to do this improvements…

Thanks

Why do you want to switch to blender then if you already got a working pipeline with 3dsmax? Don’t get me wrong, I’m just being curious to know why another 3smax user wants to switch because I used to work exactly the same way as you do, but then I got tired of paying for expensive updates so I decided to send max into oblivion. Although I could keep on working with the version and the plugins I got, blender totally made me fall in love with it, so I adopted it as my main working tool for evrything 3d I do. And I don’t regret it. :wink: Now I know I’ll always have the latest and greatest version of a super powerful 3d app without having to pay a single penny! Of course I feel committed to blender and the best way to contribute is giving something back to the community like tutorials, or helping others out, etc.
So it would be interesting to hear your version :smiley:

goetz, your second step is the one you could switch. Having worked in ACAD for 3D, well, lets just say Autodesk is counting on other programs for that function, at least as far as 2004’s version, IMO. 3DS and Blender do 3D very well. Since you have to work through the drawing, layer by layer, and create the objects with the same material in AutoCAD anyway, it seems to me that you could just as easily select layers for export by material, create .dxf’s from each file (say, CONCRETE.dxf) as 2D files, and then extrude in your 3D app. In other words: do step 2 in the 3D app, not AutoCAD.

By the way: separating your model by material isn’t completely necessary, with the exception of rendering transparent materials, if you use UV mapping. I’ve gotten to the point where I separate my objects by floor and ground plane, for ease of editing. Everything is UV mapped. This also helps if you want to do real-time walkthroughs, which require you to use the game engine.

Or you could still model in 3dsmax, UV map, apply materials and export to 3ds. 3ds keeps the material info intact. The only problem is that the 3ds format has a very low polycount limit and texture names must not be longer than 8 character (old DOS restriction). I’ve succesfully imported 3ds models in blender and all the pertinent info to materials is intact. Just take into account the limitations of the 3ds format. :wink: But I’ve found myself porting many of my previous 3dsmax work to blender via exporting to 3ds…then rendering the same projects in Kerkythea, Yafray or Indigo. It totally rules!
But if you can totally find a way of breaking any dependencies with the programs mentioned It rules even more!

afecelis: the main reasons are money and the fact that I’ve installed Blender and I liked it’s interface, even if I haven’t worked too much in it… the first thing I’ve done was to see if it can help me in my work and that’s way I’ve tried to find out if I can import 3d files from AutoCAD…

Eku: yes, it seems that’s the best way to do it for now (3d modelling directly in Blender), although I’m accustomed to model in AutoCAD, which for architecture modelling I think it’s very very good: (a) you can work very precise and fast; (b) the 2007 version has many improvements for 3d modelling, which makes it even better. The way a CAAD software works is rather different than a modeller like 3dsmax or Blender does and both of them have certain advantages…

@goetz: Thanks for your reply. Don’t worry, blender is more than capable of getting the job done. Just find a way you feel comfortable of getting your 3d info into it. (or try and model evrything in blender :wink: )
Autocad has always had the chance of exporting to 3ds. You say Acad 2007 can’t? That would be a step back in progress. Anyway, 3ds files exported form autocad always showed up corrupted in max for me, so in the end I was cleaning the 2d dwg drawings and importing them into max to redraw everything in splines and extrude there, hehehehe :slight_smile:

I also thank you for replies. They showed me that there is a very active community around this program, which is very important for someone who wants to learn…

Anyway, I think there is a big challenge for the developers to make Blender import DWG files. :smiley:

DWG is a closed format, they don’t want anyone else to be able to open it. That said I think Bentley realesed an OS library for accessing dwg files. Still I think DXF is your best bet. I don’t have any reason to try coding a DXF importer right now, but I’ll put it somewhere on my vast todo list;)

I do a lot of Autocad automation in Python, so I took a look at its interfaces for 3d. I think you could manage to rip surface information directly from Acad, but as far as I could see they don’t provide any meaningful access to solids :shrug: