Questions about DXF import code for a Revit-to-Blender tool

Hello all, my first post is gonna be a bit of a long one. :wink:

Basically, how does Blender import DXFs? Is it via the code itself, or a Python script, and if it’s via the code, could that be controlled via a python script?

I’m a (so to be) Architect, and heavy Autodesk Revit user. Revit’s like Inventor, SolidEdge, or Pro-E, but for Architecture instead of Mechanical/Industrial work. So in other words everything’s always 3D, and then the ‘drawings’ are generated off of the model.

OK, so Revit can produce DXF files. These DXF files come into Blender fine, other than every surface is sepirate, and numbered. I could spend a lot of time mapping materials and such to everything…

However, Revit puts more data into it’s DXFs, in the form of ‘xdata’ (a DXF spec term), that tells each mesh what material it is within Revit. What I’d like to do is to generate a tool within Blender that would be able to ‘see’ that data (which I’ve got the spec for and somewhat an understanding of) and then import the elements so that things of a common material are grouped together or named a certain way, so that it’s trivial to map new materials for them. It might even be possible for Blender to generate materials that match the Revit ones automatically, for that info is contained within the DXF as well.

I think this would be very useful for any Revit user, for the rendering engine within Revit isn’t very robust, and there is very limited animation ability within the software. Add to that the fact that while Revit is better (IMHO) than anything else when it comes to modeling a building quickly, it’s not so hot on small curvy complex forms like modern furniture and such. So having the ability to bring a Revit model into Blender for interactive walkthoughs & animations & GI renderings via Radiance (what I use) or Yafray would totally rock.

So, what I need to know is: How does Blender import DXFs? is it via the code iteself (which is my guess) and not a Python script? And, if so, could a python script ‘drive’ the DXF import code to allow it to filter/organize the imported meshes into different groups/names/materials?

Thanks everyone!

The DXF import is inside the code and i doubt you could filter via script (aldow my knowledge is very limited).

The only thing i could get, in case you want to write a script is this
http://www.autodesk.com/techpubs/autocad/acad2000/dxf/

good luck

You could certainly create a second DXF import through a python script. But you’d have to re-do the whole import. Another option is to read only the Xdata and modify the resulting meshes from a normal DXF import. in either case it will require writing python.

Thanks for the link to the DXF spec, I’va already got that tho and was studing it for another idea I had prior to decided to focus more on Blender.

I’m guessing I’ll have to write some level of Python to make this happen, I was just wondering how much. :wink:

About reading the DXF’s Xdata via a script and having Blender modify the already-imported DXF meshes is interesting, however I don’t know how Blender would know which mesh was which.

Thanks all for telling me where to look, and if anyone else has any ideas, I’d love to hear them.

If it helps. A few months ago I asked people at blender if it woulb be possible to import DXF drawings containing ACIS solids (I works with Bricscad, a sort of an Autocad clone, but reasonably priced). I got an answer from Kent Mein and he said that it would be improved/implemented in the future. So, try talking to Kent and maybe he will have some more info on that.
good luck

nuno

from Portugal