DXF import script for Blender 2.5

thank you for correcting it, i will commit it to trunk.

Is it just me or is the addon not listed in the directory any more? I’m sorry if it is just me being blind, but I really can not find it. I tried the last direct link which did lead me to the a file, but for some reason it will not install in 2.57.

I tried with a few other addons from the same directory just to make sure that it wasn’t my blender that was acting up, and those addons worked fine.

@hufse:
Since 2.56 the DXF-importer is bundled with official release, you don’t need to install it manually.
There is a link to the newest version on manual page:
http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Import-Export/DXF_Importer

Hi migius :RocknRoll:

I’m actually trying to import a dxf file into blender 2.57. but I only got this error message :


SO I tried to import into blender 2.49b and got this :


Actually you can see that the curves that should be vertical are flattened on the ground. Also the window’s glass that should be made of NURBS is rendering a strange geometry.

I also noticed the file was considered linked and I couldn’t enter in edit mode to make some uv mapping for example.

I also want to say, this is a dxf file generated by Rhino, when I import it in Autocad or Draftsight it imports perfectly in the blink of an eye.

So here is the last problem, the blender import is extremely slow : I imported a 9 MB file during 4 hours, then I stopped it and imported some smaller files to test and got the results I showed you up :spin: Actually the small file was 450 kb and needed something like 20 seconds to load on an i7 2600K processor.

I hope this helps :slight_smile:

Choco Choc, welcome on forum here!
thank you for the report.

issue with 2.57 is probably a wrong code parameter - try another codepage than “ascii”

issue with 2.49 is more interesting, it seems it ignores some rotation information of BLOCKs - please send me this dxf file for bugfixing.

problem by switching into edit-mode concerns dupligroups used here as representation of BLOCK/INSERTs.
You can edit geometry of dupligroups due editing their original group on layer 19, or after converting dupligroups into real objects by pressing Ctrl-Shift-A.

Yes, Blender becomes extremely slow by loading bigger dxf files. The only solution i know is the 2.49b-CAD-edition

I hope this helps :slight_smile:

Hey migius,

I was expecting from the forum to notify me when you answer…so since I never received a notification I only happened to see your post now…so sorry for the delay !

I can’t put too many links in that post since I’m new to the forum so here a textfile with the links…

So, here is the file that you thought of as interesting :

Link 1 refer to txt

now for this file I linked above, if you try and import it in Blender 2.57a it won’t work with any codec. with the iso one the console will happily say “importing done” but blender won’t have imported anything :o

So I tried with other models…all coming from Rhino export as dxf format : one of them worked with ascii codec but added a segment from the object to the global origin, like this:

Link 2 refer to txt
Link 3 refer to txt

I tried with another file and it only worked with the iso codec. BUT as you can see below, it didn’t import thickness and curves when those two options were checked. However, you could see that on the speed, rather than taking 4 hours it took 10 seconds or less…:o

Link 4 refer to txt
Link 5 refer to txt

Please note that all those files were generated from Rhino.

Dupligroups ? I got to admit I’m new to blender so I’ll be digging it a little !

Hope you got what you need :slight_smile:

Choco Choc, thanks for details, effectively i can look into it next week first.

Helloooooo :D,

wondered how it was going :slight_smile:

cheers !

me too :smiley:

can’t wait to see it on Blender 2.57 working

Hi migius,
Thanks for the work.

Look, If Rhino doesn’t do it, I can try to see in Autocad or Draftsight, they open the file perfectly, so then I can save it the way that pleases us :).

I’ll keep you informed soon about this.

Cheers !

Hi migius,

Good news, not only I can import my curves correctly now whatever the version of dxf I chose in Rhino, but also, the export is much faster. You remember I told you I just aborded the full model import after 4 hours of loading last time. This time it took 1 minute :smiley:

For the partial model (the 3 doors) it passed from 30 secs to less than one sec :slight_smile:

The curves are imported correctly and all.

Now depending on the blender version I got different results. the 2.49b import’s volume looks the same as when I import the file in Autocad, so it seems to be pretty good. But the 2.57b version misses some volumetries or I dunno what.

However I think I read somewhere you were waiting for blender 2.6 to make the script compatible and I think using 2.49b during this time is not a problem.

But there is still one thing I couldn’t get to work : I only get the vertexes and edges, but no surfaces Oo

Here a screenshot and the dxf file again :slight_smile:

dxf file
http://moubine.free.fr/nofaces.jpg

I wanted to edit last post to add the .3DM file of the last example (the rhino original file) but the forum won’t allow more urls in the same post (this is just a pain).

3DM is an open format used by a lot of cad applications so I think it will be easy to look inside it !

3DM file as .RAR

nice to hear this :smiley:

Now depending on the blender version I got different results. the 2.49b import’s volume looks the same as when I import the file in Autocad, so it seems to be pretty good. But the 2.57b version misses some volumetries or I dunno what.
However I think I read somewhere you were waiting for blender 2.6 to make the script compatible and I think using 2.49b during this time is not a problem.

yes, i am going to complete the importer for 2.6 release

But there is still one thing I couldn’t get to work : I only get the vertexes and edges, but no surfaces Oo

There are only (NURB-)SPLINEs in your dxf files - they are curves not surfaces - there is no way to create surfaces from them at importing time.
Have you tried to convert/export to POLYLINES/POLYFACES from Rhino?

Hey migius,

Exporter for 2.6 version coming is great news :smiley: !

Yes, my bad, Rhino is set by default to convert surfaces into curves…so I switched it to mesh and it worked :slight_smile:

However it’s a “give and take” since now I got the faces, but lost the instances :o

The plan to port back the DXF-importer from 2.49 is on hold
due to minimal feedback and missing support from users.

I wish more people were willing to participate in development costs.

There is a donate button on my project homepage www.cad4arch.com/cadtools/
and i would appreciate if you use it from time to time :wink:

> professional users <
More reliable DXF importer in Blender will make your life easier!
Consider to sponsor this project.
I can write you an invoice for your payments on CAD-consulting basis.
thank you
migius

new to blender… i have loaded 2.61 and was wondering if someone has the .py script for importing .dxf files…

have you managed to put something together for 2.6 yet?

Hi migius,
I just wanted to drop you a quick line expressing my gratitude and appreciation for the work you have done. Thank you!

you are welcome, thanks.

I will try to fix it before official 2.63 release. Be patient please.
In the meantime you can use 2.62 for imports.