Friday, October 16, 2009

LDraw Tutorial - Part 1

For those without any CAD experience or who are not very handy with a computer, LDraw and the programs associated to it may appear quite complex. However, with some basic explanations and a bit of practice you can learn to use them quite quickly.

For many of us it is important to be able to document our creations and ideas. Traditionally we have used photos, especially since the appearance of digital cameras. Some have also tried to make drawings of their designs. The creation of the LDraw parts library for a simplified version of CAD (Computer Aided Design) has made this task a lot easier, to the point where some have made MOCs without actually having the physical parts.

For those who have no experience with CAD or who are not particularly handy with their computer, LDraw and the programs associated to it may appear quite complicated, but with a few basic explanations and some practice you can learn to use them quite quickly. In this first part of my LDraw tutorial you will learn to take your first few steps with MLCad, a program that allows you to use the LDraw library quite easily.

First steps with MLCad

Mike’s LEGO CAD (MLCad) is computer aided design software which uses the LDraw parts library. In order to be able to use it you will have to install both. The LDraw website has a link to an installation package that contains both MLCad and the LDraw library as well as a number of other useful applications. Download* the package and do a basic installation which will set up the LDraw parts library, MLCad and LDview. Simply accept every time the installer requires your input and you are ready to go**.

The first time you open MLCad it will ask you where the LDraw parts library is. If you didn’t change anything in the installer it will be located at C:\LDraw. Once you get the MLCad interface you can change the position of the icon bars to your liking, for example like this:

  1. Tool bars
  2. Parts tree
  3. List of used parts
  4. Construction area

Before you try to build anything let’s take a look at a construction that comes with the installer. You can find it at C:\LDraw\Models and the file is named PYRAMID.DAT. (In MLCad go to File>Open and browse to the location of the file, select and click ‘open’). Now take a good look at how the Pyramid has been built. You can see the building process step by step (or layer by layer) if you select “View” mode, the first icon on the Model bar:

Click on the image of the pyramid to advance to the next step.

Once you are familiar with the way the pyramid is built it is time to try to copy the design. Open a new document (File > New or Ctrl+N). Now go to the parts tree and click on the + to the left of ‘bricks’. The tree will expand and you can scroll down to select a ‘Brick 2 x 4’. Alternatively you can select ‘Brick’ in the drop down menu in the lower part of parts tree (just above the images) and use the scrollbar to visually identify the part you need. Click on either the description or the image of the part and drag it into the construction area. You can drop it in any of the four panes, although it is usually better not to use the 3D pane for this.

In order to change the colour of the part, click on the colour of your choice in the Color bar. In this case you will need to make it Blue.

Drag another Brick 2 x 4 into the pane of your choice and drop it next to the first brick. You will notice it is blue (the last colour you used).

The third brick needs to be placed at an angle of 90 degrees, which means you will have to use the Transformation bar to rotate the part:

You will find that it is not always easy or reliable to move a part using the mouse. However, using the Transformation bar isn’t always that comfortable either, so you may want to learn a few short-cuts to help you work more easily:

For moving parts the following short-cuts apply

For turning you use the same keys in combination with the Control key

You can only move or turn a part while it is selected, but when a part is selected it is outlined with a thin line that sometimes makes it difficult to see if you aligned it properly. You will have to unselect the part /e.g. by clicking on an empty part of the workspace) to see if the part is correctly placed. If you are still having trouble placing the part correctly you may need to change the grid size. You can do this in the Model bar (there are three greyed out icons in the image of the bar above, representing the three available grid sizes) or using the short-cuts F9, F10 and F11 for those same three grid sizes. When you change grid size you also change the angle steps with which a part rotates. Typically you will rotate a part 90 degrees per step in the large grid and 45 degrees per step in the medium grid.

When you add the next part you will notice it has again acquired all the characteristics of the part that was selected when you added it: the colour and rotation will be the same. There is another way of adding the same part again which is using copy (Ctrl+C) and paste (Ctrl+V) If you do that you will notice a new entry is added to the parts list, but the part doesn’t show up in the construction area. This is because the part takes up the exact same space as the part you copied it from! But if you move the part using the arrows or the short-cuts you will see it come out of that part. This means that you need to be very careful when building something in MLCad, because it is possible to put parts entirely or partially inside other parts. You can also select several parts (holding down Ctrl while you select them either in the construction area or in the parts list) and copy and paste them at the same time.

When you have finished the first layer of the pyramid it is time to indicate you have finished the first step. Go to Edit > Add > Step or use the third icon on the object bar:

This way, when you select view mode, all the parts added between one step and the next are shown at the same time.

Whereas you will probably have used only the top view up to this point, you will now have to use the Front or Right views to be able to place the next layer of bricks on top of the first one. You should now be able to finish the pyramid. Don’t forget to insert a Step every time you finish a layer.

*) You will have to type in the contents of the Captcha image which has been added to avoid automated downloads

**) This installation process is for Windows users. If you use Mac you will have to learn to use Bricksmith instead of MLCad. If you use Linux you are supposed to know what you are doing , MLCad will run fine on a basic Wine installation.


Alex Campos said...

Great tutorial! It is rare to have both the knowledge and the ability to clearly explain it!

One thing, though: currently almost all the programs in the All-in-One installer are obsolete versions, especially the Parts Library. The best is still to install everything individually (in my case, Parts Library, MLCad, LDView, LSynth, LGEO, L3P, L3PAO, POV-Ray and LPub), although I recognise this is a quite daunting task for beginners. Hmm, indeed the best to "get one's feet wet" is to use the All-in-One installer, and then, when one has enough confidence and starts feeling the limits of the old versions, uninstall it and replace it with individual versions.

blakbird said...

Great job on your thorough introduction. A couple of points I thought of are that:
1. MLCAD only runs on Windows. There are other editors such as Bricksmith on Mac and even other Windows editors like LeoCAD.
2. It is worth pointing out the difference between the library and the editor. The library contains the parts which are just ASCII text files which will work on any platform. The editor(s) manipulate these parts (or even author new parts) to build models, assemblies, and even instruction steps. Then there's also viewers like LDView which don't actually change anything but look really cool!
3. The coordinate system for MLCAD has -y as the up direction. Consequently, your keyboard shortcuts are not right. The up down arrows are Z, not Y. Page up and down are Y.

TechnicBRICKs said...

Jetro is finally on-board.

Congratulations for the post and the subject, Jetro. It is a very good start!
I believe it is also an added value, for many of the TBs readers.

Parax said...

Thanks for that tutorial, I'm sure it will be very useful for those new to MLCAD. Perhaps in Part 2 (I presume you realise what you've started! >:oP) you can cover adding new parts to the library. This has caught me and others out before! for example the
32449.dat 1x4 liftarm (without boss) part.


Jetro said...

1. The second note was added precisely because of this. The easiest way to start with LDraw is using the Windows installer and so the obvious first choice is MLCad.
2. All in good time :D
3. Thanks for pointing that out. I originally wrote this article in Spanish and I evidently didn't pay enough attention during translation :P

Did you hack into my PC or just read my mind? The next part will indeed be about adding parts to your personal library. As for part 3 ... no, let's keep that a surprise :)

Related Posts Plugin for WordPress, Blogger...

© 2007-2014 TechnicBRICKs
TechnicBRICKs contents may be sporadically updated, if the authors finds further relevant info about a certain post, or content/spell mistakes. Hence please don't be surprised if you find few changes at later visits, relative to a previous read.

TechnicBRICKs often shows other peoples' creations and/or images. We always try to credit the author(s) and link to their main publishing website, and if possible with their name in real life.
Since this is not always possible, we request that if you find something here that is yours or from someone you know, you leave a comment on the respective post and claim the authorship.

TechnicBRICKs is optimized for Firefox 16.0 and 1600x1200 resolution displays or wider.

LEGO® is a trademark of The LEGO Group of companies which does not sponsor, authorize or endorse this blog.
LEGO, the LEGO logo, the Brick and Knob configurations, the Minifigure and MINDSTORMS, are registered trademarks of The LEGO Group.
Original LEGO images are copyrighted by The LEGO Group and are used here in accordance with their fair play policy.
You can visit the official LEGO® website at