HBM003: LDraw Tutorial (III)


LDraw Tutorial (III)

If you lose time looking for the pieces that you need, this issue will be very useful to you

 

Text by Jetro

Images by Jetro and Philo

 

Frequently used pieces

The left pane of MLCad gives you access to all the parts in the Parts Tree (in the top part) and images of the parts included in each category (in the bottom part). This Parts Tree by default only has a limited number of frequently used categories (Brick, Baseplate, Plate), whereas the rest of the parts are grouped in alphabetic order in the "Other Parts" group.

However, it is possible to personalise the organisation of the Parts Tree in such a way that those that we use frequently are easily accessible at all times. To this end there are two tools which I will now describe.

Favorites

The Favorites folder of the Parts Tree can contain a copy of all the pieces you are going to need at a certain time. There are two ways to add parts to this folder. The first is by locating a part in the Parts Tree, right clicking on the name of the piece (doing so on the image will only increase or reduce the size of the image) and choosing "Add To Favorites". The part will now appear in the Favorites folder, as well as in its original location.

A second way of adding all the pieces we need is by editing the MLC_Favorites.txt file which is located in the folder where MLCad is installed (by default C:\LDraw\Apps\MLCad). This plain text file contains a heading [FAVORITES] followed by a list of all the pieces that are in the Favorites folder. You could have several files, each detailing the contents of a single set you would like to base a particular construction on (e.g. the inventory of the NXT) and manually substitute the contents of the MLC_Favorites.txt file with that of the set you want to use.

In order to eliminate a single piece from the Favorites folder you need to right click on the name of the piece and select "Remove From Favorites". The part will continue to be in its normal place. You can also erase the whole content of the Favorites folder by right clicking on the name of the folder and selecting "Clear Favorites".

Creating New Categories

Another way of getting a better access to certain pieces is by creating new entries in the Parts tree. As usual, there are several ways to go about this. One of them would be going to Settings > Parts Tree > Tree Configuration... The window that opens allows you to modify the names of the existing categories, change the order in which they appear and add new categories. In order to add a new category you need to write a Name and Search String.

As you can see in the list of existing categories, each STRING must start with < and you can use the special characters | (meaning 'or') and & (meaning 'and') in order to make a more specific selection. Slopes and wedges, for example, are often used together, and you may want to create a category that includes both. If you write “Slopes &amp; Wedges” as the name and we use the “<slopes | wedges”, in the parts tree you will see there is now a new category with all the pieces whose names include either one of the string values.

If you want to create a category that includes all the bricks that have hinges and fingers the STRING would be “<hinge & brick & finger”.

Contrary to what happens when you include parts in the Favorites folder, in this case it isn't possible (or very complicated) to select a number of individual parts, and the parts that appear in the new category are no longer available at any other location (except Favorites if you choose to include them there).

 

 

Models

Who said a part can only be a single element? If you want to reuse a sub-assembly or keep it handy for future use, you should save it in the LDraw\Models folder. All the elements that are saved here appear in the Parts Tree under Models. Keep in mind that if you use them in a new construction, in order to be able to see all the parts correctly, all the subassemblies you have used from the Models folder need to remain available there. Otherwise, when the file is loaded it will give you an error message because the part it tries to load is no longer available. If you want others to see your virtual creation, you need to make sure you include a copy of all the files from the Model folder you have used in the same folder as the main file.

Document

Just like the Models folder, Documents contains subassemblies, but in this case only those that are contained in the MPD file you are viewing. This way, in stead of having to worry about placing all the necessary files in the same folder, everything is contained in the same file. However, these subassemblies cannot be easily used in new constructions. Sub-assemblies that are saved anywhere on your hard disk can be imported into an MPD file through the file menu “Multipart >Import model” which will insert a copy of the sub-assembly in the MPD file.

Grouping Parts

Even if you work ith sub-assemblies, at times these can be so complex that it is necessary to work with a selection of the parts as a single unit. At other times you may want to move several parts at the same time. Grouping parts is really easy. You could try to select the parts you want to group by clicking on the graphical location of each while maintaining the Ctrl key pressed, but you will soon notice that some parts cover others and you can't reach them. For this reason it is better to select them in the parts list (keeping the Ctrl key pressed). After selecting all the parts you wish to group, go to Edit > Group > Group (or Ctrl+G), write a name for the group and click OK.

You will notice that the selected pieces now appear on a single line which shows you the type is GROUP, there is no information on the position, rotation or number of the part, but you so see the name you selected for the group. If you need to change or move a single piece you will have to undo the group in order to be able to access it. To this end, select the group and go to Edit > Group > Ungroup. Each part will reappear in the same place of the parts list it was before you created the group.

Turning parts ... or groups

In the first part of this course I explained about turning parts using the arrow icons in the elements bar or using keyboard shortcuts and I that in order to improve the precision of turns you need to select the right grid. But there is another important factor to be considered: the rotation point. By default the rotation point is the one predefined for the part (usually the centre of the top face) and in groups it is the default rotation point of the first piece that was selected when creating the group. However, this is not always the most convenient point in order to easily fit the part or group.

In order to change the rotation point, first select the part or group you wish to turn. Then go to Settings > Rotation Point... In the window that now opens you can choose between several options. The first one (Part origin) is especially useful if you have made some changes that you want to undo in an easy way. To see exactly where the rotation point is located you can mark the checkbox next to "Show rotation point" towards the bottom of the window (this won't take effect until you close the window). If you select "Custom point" you will also be able to mark the checkbox "Allow on-screen change" which allows you to drag the rotation point to the most convenient location. Keep in mind that, since we are working with a CAD system that only allows modifications in two directions in each pane, you will probably need to move the rotation point in at least two panes to get to the ideal location. To finish off, you can assign a name to the position, which allows you to easily reuse the location later on.

 

 

Another way of locating the ideal rotation point is by using a helper part you can download from http://www.holly-wood.it/files/Helper_Her.zip

After importing the piece into the LDraw library, the piece will show up under Other parts > H since its name is "Helper – Easy Rotation". Just like with the rotation point, you will need to adjust the location of this piece in at least two panes, but it may be easier to do since the piece is bigger. There's an additional advantage to using this method: you are using a part and the rotation point of a group is always that of the first part you select. So if you select this piece first you are sure to get the rotation point you needed. The part isn't located in the most convenient location o the Parts Tree and in a later tutorial I will explain how to put it in a more appropriate category.

Flexible parts

Up to now we have seen how to locate, insert and turn parts with a defined shape. But there is also a small number of LEGO parts that don't always present the exact same shape: belts, treads, tubes...How can you include these in an LDraw file? Let's start with rubber belts. MLCad includes a tool for generating simple rubber belts in a fast and easy way. You can open this Rubber Belt Generator by going to Extras > Generators > Rubber Belt... or by clicking on the seventh icon of the Extras bar.

The first field is for the horizontal distance between the axis of the pulleys you are using and the second for the vertical distance. The next two values are for the radius of each of these pulleys. Philo has created a small table with the radius of the parts most commonly used for this task and for a belt thickness of 4. This is the fifth value you can enter into the generator. Finally you can enter a value for Precision, to indicate the number of segments to be used for half a circle.

 

 

If you unselect "Use cylinder" the generator will create belts with a square section. If selected the belt will be generated using the 4-4cyli.dat primitive.

All units in this window are LDU (a 1x1 brick is 20 ldu wide and 24 ldu high without counting the stud), the same scale that is used in the rest of MLCad. To find out the distance between two centre points, place the cursor over the first and write down the x, y and z values that appear in the bottom left corner on the status bar. Do the same for the next centre point and you will be able to calculate both X and Y distance for your belt.

Belts generated in this way can be inserted directly into your LDraw file. If you do so you will see a total of 34 pieces appear - 32 for a full circle (provided you haven't changed that value) and 2 straights. You can also insert it as a new submodel (like in an MPD file) o as a new model (save whatever you were working on before because a new file will be opened). However, the easiest way to use it is as an MLCad Part which you can handle like any other part.

This generator only allows you to create simple belts, around two pulleys and in a single plane. Sometimes you may need more complex belts or other flexible pieces. In the next part of this tutorial we will have a closer look at how to do that. ■

 

 

 

..