LdrDat2Dxf and LdrDat2Obj


LdrDat2Dxf - a Windows program written by Rolf Redford that can be used to convert LDraw models into Autocad DXF files


LdrDat2Obj - a Windows program written by Rolf Redford that can be used to convert LDraw models into Alias|Wavefront OBJ files


See below for download links

Here is an edited version of the author's original description of the software...

I made this program based on old Dat2Dxf program which apparently isn't supported anymore. A download link is at bottom of the page. I recommend you to read entire site, since there's some important notes related to functions of both the LdrDat2Dxf and LdrDat2Obj converters. One converts Ldraw to Dxf, other to Obj. Dxf is more widely supported but very limited on color and has no alpha support. Obj have much more support for textures and alpha so clear/transparent pieces are possible without having to set colors again like with dxf format. I will note differences between dxf and obj export when needed.

LdrDat2Dxf screenshot 1

Using it is very simple actually. If it's first time you have to find parts directories for it. It will need to know location of ldraw.exe. It assumes that it is in P, Parts and models sub directories of folder the ldraw.exe is in. To convert a single Dat or Ldr to a Dxf/Obj file, you just click on Change Import/Export button. First it will show a file dialog, use that to find and open a Dat or ldr file, then click on open button. Next it will open the save dialog. Use it in the same way that you would use a usual save dialog. Now it will show the filenames with directories. Review it to make sure they're correct. Now, click the Convert button. it will show a progress window, and main window will hide away. When its done the main window will come back and you have nifty Dxf or Obj to use in rendering program! If you want to convert a bunch of dat or ldr files, you can click on Batch Convert. New window will appear. You can browse and add files from any location but it can only export to single location. The dxf files will be named same as dat and ldr but with extension of dxf or obj and in export folder. When you're done just hit convert button and it will get busy.

LdrDat2Dxf screenshot 2

There are 3 layering, or grouping choices. Line Number as Layer is best since it will make each part of model as its own layer. For example, if you import dxf or obj of 2 bricks into Bryce, then ungroup it, it will be 2 models of bricks. Other is step as layer. It will set steps to layer. for example if there is 3 bricks added in a step those 3 bricks will be in same layer. Third happens if both options are not checked. It will be single layer, meaning you can't split or ungroup it.

*Note Bryce sets all colors to its own groups on top of format's own native grouping, I don't know if it applies for other programs, so if there's no other grouping type, it will be set to same color grouping, but if there's grouping to "line number" then each brick, if have more than one color, will be split to each color. I can't fix this "feature" in Bryce.

Bow Tie repair is useful if exported model have bow ties. I'm not sure if its working properly but there's 2 options, one that's quick and dirty and one that checks slowly. I suggest you don't use it unless the model has bow ties. Ignore all file errors tells LdrDat2Dxf or LdrDat2Obj to ignore any file not found errors, which is good for certain problems such as not having a unofficial file or such. Remove Studs is just that, while it processes, if it finds any stud sub part references it skips over that file, so model will not have any studs. It will lessen polygon count. In some cases, a very large polygon count savings. The Dxf file you have just converted from Ldraw format is now ready to be imported into any rendering program! Obj needs just one thing to be done, you need to copy Legocolors.mtl (included in the LdrDat2Obj download) to same folder your new obj file is in, then it's ready to be imported!

*minor note: Legocolors.mtl was hand-written by myself, but I am not expert on this, so colors are a little off, but if you're good on making an MTL file, then you could help me by making a more accurate materials file, but that's the advantage of having the materials separate from obj files. I also didn't define any dither colors, but that file has all of the regular Lego colors ready. It's still beta so feedback and bug reports are very important for me, and thanks in advance for any of them.

The Microsoft .NET Framework needs to be installed on your system prior to running LdrDat2Dxf or LdrDat2Obj.

See below for download links.

LdrDat2Dxf - version 1.0
LdrDat2Dxf - version 2.0 (beta) - includes grouping options

LdrDat2Obj - version 1.0

(Alternatively click here to download from the LDraw site)
LdrDat2Obj - version 2.0 (beta) - includes grouping options

DAT2DXF

 

LEGO© is a trademark of The LEGO Company which does not sponsor, authorise or endorse this site.