Holly-Wood.it  
    Brick 1 x 3
Brick 2 x 2 Corner    
  Brick 1 x 1  
[ english ] deutsch ] italiano ]
 
  Home > MLCad > Tutorial: Customizing MLCad  
    Brick 1x2
 
 

Tutorial to customize MLCad a bit through the MLCad.ini file

 
 
 
     
  The MLCad.ini file tells the minifig generator in MLCad and LeoCAD as well as Bricksmith (the counterpart LDraw editor in the MAC world) which parts are available. In addition, the file defines the order of scanned folders during the launch of MLCad, which comes handy when dealing with unofficial LDraw parts and finally it rules the interaction with LSynth. If your installation doesn't come with a MLCad.ini file download it from the MLCad.ini tutorial page.
 
     
  NOTE! A french translation of this tutorial can be found at J.C. Tchang's website: http://jc-tchang.philohome.com/manuel/mlcad_ini.htm.  
  Brick 1x6  
  Screentshot Editor
   
  The MLCad.ini file is a simple text file, editable in an editor or a word-processing program, but since it is stored in the Program folder the text editor has to run as administrator with full elevated rights and privileges on Windows Vista or higher. Right click on the program's shortcut and click on Run as administrator. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an administrator.

NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.

The MLCad.ini is grouped in three sections:
 
     
  Minifigure generator
Scan order
LSynth
 
     
 

Minifigure generator

 
     
  This sections gives you full power over the selectable elements, but this also means that the chart has to be updated every time LDraw releases a new parts update containing minifig parts. You can add the new code by yourself, following the instruction below or just download the file from here, since Holly-Wood.it is the official maintainer of the .ini file.In case you wanna add unofficial or custom minifig parts there is one block per minifig element: Hats, Head, Body,... The block names are mandatory - if they are missing or wrong MLCad uses an internal default instead, which is different from the content in the file! Each element line has the following format:

"<Display name>" "<DAT/LDR file name>" <Flags> <Matrix> <Offset>
 
     
 
<Display name> The name of the element as it is displayed in the element list
<DAT/LDR file name> The file name of the element or "" for hidden element
<Flags> Always 0 reserved for future use
<Matrix> A rotation matrix a11 a12 a13 ... a33 for optimal appearance at 0 degree rotation angle
<Offset> The offset of the part to be in place
 
     
  In the example I'm gonna add one of the torso you can find on the page with the custom parts I've designed. It takes for grandet that you have already read the Easy rotation tutorial or checked out the scan order tutorial below and know how to install custom parts.  
     
  Screentshot Minifig Generator 1
   
  1. Open the MLCad.ini file (you will find it in MLCad's root folder) in an editor or a word processing program and scroll down towards the end of the document 'til you come to the [BODY] section which administers the torsos.  
  2. Insert the data according to the format above. For the Boobsp2.dat it would look like this:

"Boobs with Bra Pattern" "Boobsp2.dat" 0 1 0 0 0 1 0 0 0 1 0 0 0

In case your part doesn't require special rotation or positioning values like minifig accessories it is best to copy'n'paste an existing entry and substitute just the naming and part number. It is however good advice to flag custom inserts properly. MLCad encourages this and interprets lines beginning with ";" as comments, while empty lines are ignored.
 
       
  Screentshot Minifig Generator 2
   
  3. Save the file. Opening the Minifig Generator the new part will be immediately available.  
       
    NOTE! You might keep the editor open after you have saved the new content. In fact MLCad deals just fine with an open .ini file. This behaviour is especially welcome when refineing the matrix by trail'n'error. All you have to do is:
  • Closing the Minifig Generator by hitting Cancel.
  • Make your changes to the MLCad.ini file and save it.
  • Once you fire up the generator again the new values will apply.
top  
  Brick 1x6  
 

Scan order

 
     
  This feature has been thought to include unofficial and custom parts into MLCad, without the need to mix them with the official LDraw parts in the \PARTS and \P folders. DAT files found in the scan will be included in the parts library and - depending on the flag - show up in the parts tree library and parts preview window. Take notice that this feature is NOT equal to the File > Scan Parts command and therefore will NOT rewrite the Parts.lst file. Other LDraw tools depending on the Parts.lst file might not recognise LDR or MPD files containing such "external" parts!

The start-up of MLCad will be slowed down depending on the number of folders and sub-folders to be scanned. The syntax supports extended ASCII-code.

The section starts with [SCAN_ORDER]. One line per directory to scan, which has to have the following format:

n = <SHOW|HIDE> [<LDRAWDIR>]["]Pathname["]
 
     
 
n Progressive number
SHOW Will display the parts found inside this directory in the part-library and/or part-preview window
HIDE Will NOT show the parts found inside this directory in the part-library and/or part-preview window
<LDRAWDIR> The keyword to indicate relative paths - this has to be specified in brackets < >
["]Pathname["] Subdirectory inside the LDraw base path or absolute path including the drive name. Note that if your filename contains spaces, the entire filename must be enclosed in double quotes. (This is standard for any Windows command line with long filenames).
 
     
  \P, \PARTS and \MODELS are mandatory paths and are always present even if not specified. If not declared those will be scanned last. If the keyword <LDRAWDIR> is omitted the path is assumed to be an absolute path.

Looks weird? I'll show you my personal settings to get a clearer picture.
 
     
  Screenshot Scan Order 1
   
  NOTE! In case MLCad is unable to read the <LDRAWDIR> keyword indicating relative paths you have to either define LDRAWDIR as environmental variable in your OS or omit the keyword altogether and define the absolute path (if your filename contains spaces, the entire filename must be enclosed in double quotes which is standard for any Windows command line with long filenames). With the library stored in C:\Programs\LDraw\ the code would be:

3 = SHOW "C:\Programs\LDraw\Unofficial\Parts"
4 = HIDE "C:\Programs\LDraw\Unofficial\P"

There is currently a program of the LDraw System (LDView a platform independent viewer written by Travis Cobbs), which automatically checks the LDraw.org Parts Tracker via Internet when it comes across a file missing on the harddisk. If the part exists on the Parts Tracker, it will be automatically downloaded and used. Additionally Bricksmith a Mac editor written by Allen Smith also supports files stored in the Unofficial folders.

Some of the major LDraw program authors have agreed to adopt this location as a de-facto standard after the LDraw Standard Committee - LSC has rejected (voted down) on March 07, 2007 a proposal to make the "Unofficial" directory an official location for unofficial files.

Opening the MLCad.ini file downloaded above you will notice that those directories are included, but have been commented out since MLCad doesn't support automatic download yet . To activate the scan just delete the semicolon in front of those two search paths. This means also that manually downloading the package containing all the current unofficial LDraw parts from http://www.LDraw.org/article/14.html you must unzip the parts as following:
 
     
 
ldrawunf.zip <LDRAWDIR>Unofficial
parts -> Parts
parts\s -> Parts\s
p -> P
p\48 -> P\48
top  
  Brick 1x6  
 

LSynth

 
     
  The sections tells MLCad the absolute path to LSynth and defines the available synthesis:

%PATH = <path name>

Example:
%PATH = "C:\Programs\MLCad\LSynth"

NOTE! The definition points to the path containing the bin\ folder and NOT the program lsynthcp - the console based synthesizer that reads in the DAT file and writes out a new DAT file with the synthesized parts. The quotes are important in case your path contains blanks.

Following the path the section lists the available synthesis types. Since all synthesis are already listed you don't have to edit this portion. I'll show you the format just for completeness:

<TITLE> = <COMMAND STRING>
 
     
 
TITLE The name displayed in the combo box of the "Add LSynth Command" dialog
COMMAND STRING The command to be added to the project. Please refer to LSynth's documentation for a deeper insight
 
     
  Example:
;Axel, cable hose and string types LSynth knows about:
FIBER_OPTIC_CABLE = SYNTH BEGIN FIBER_OPTIC_CABLE 16
FLEXIBLE_AXLE = SYNTH BEGIN FLEXIBLE_AXLE 16
;Band, belt and tread types LSynth knows about:
TECHNIC_TREAD = SYNTH BEGIN TECHNIC_TREAD
Tangent Statement: INSIDE = SYNTH INSIDE

NOTE! Regardless of the order of the statements in the .ini file the combo box will sort and list the synthesis types in alphabetical order.

You may have also look at the LSynth/MLCad Tutorial for additional information.
top  
     
  LEg GOdt!  
  Brick 2x4
All content is provided as is, with no warranty stated or implied regarding the quality or accuracy of any content on or off this site.
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this site.