Holly-Wood.it  
    Brick 1 x 3
Brick 2 x 2 Corner    
  Brick 1 x 1  
[ english ]   [ deutsch ]
 
  Home > MLCad > Tutorial: Adding unofficial LDraw parts to MLCad - Page 1 of 2 Last update: 31.10.2014  
   
  Page 1 2 Next>
 
 

Adding unofficial LDraw parts to MLCad

 
 
 
     
  Please remember: These are unofficial parts. They may be incomplete or inaccurate, and it is possible that when they are officially released they may be changed in ways that could mess up any model you use them in!

This tutorial will teach you how to add not yet certified LDraw parts to MLCad's parts library. Furthermore it will show you tips and tricks and help with troubleshooting problems you might encounter. The tutorial is based on MLCad 3.4 and it is grouped in three sections:

Downloading the parts
Editing the MLCad.ini file
Sharing models containing unofficial parts

Table of Content

Downloading the parts
Editing the MLCad.ini file
Sharing projects containing unofficial parts
   • MLCad
   • LDView
   • LPub
   • MPDCenter
 
       
 

Downloading the parts

 
     
  Generally, LDraw.org recommends you to grab unofficial parts one-by-one from the LDraw Parts Tracker and use them only for a specific project. But, if you're impatient, sure you want all of the unofficial parts and are willing to take your chances, you can download all of the unofficial parts at once. Brick 1x2
     
  Brick 1x6
Screenshot LDraw.org
   
  Navigate to the LDraw Parts: Unofficial Parts page at LDraw.org, click the link Download Unofficial Part Files and save the ldrawunf.zip file to your harddisk.

NOTE! The package is updated every 5 minutes, but if only there have been any changes. It contains ALL unofficial parts currently submitted to the LDraw Parts Tracker. This includes also parts with a Held vote which have some issues and might radically changed before release.
But also parts with one or two Certify vote(s) may be incomplete or inaccurate, and it is possible that when they are officially released they may be changed in ways that could mess up any model you use them in. This is most true for rotation and origin. See below a worst-case-scenario where origin and rotation of the slopes and the tires have been change for the official release.
 
     
 
Dumper Dumper Messi Brick 2x2 Corner
Parts are used with the rotation and origin as suggested by the part author during submission Changed rotation and/or origin after the review process affects the model once the official library update is installed  
   
  You could simply dump the parts into your LDraw\Parts and LDraw\P directory and rebuild the parts list file Parts.lst by selecting File > Scan Parts in MLCad – but it would be very hard to sort them out of there later.

The best (that is, the safest) way to install these files is to unzip them to a directory named Unofficial in the LDraw Parts Library directory.

NOTE! 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 and custom files.

Starting with the 2014-01 LDraw All-In-One-Installer the LDraw Parts Library has been moved from the LDraw root folder in the Windows Program Files (x86) folder to the Public Documents folder located in "C:\Users\Public\Documents”. This was done to circumvent file virtualization by the User Account Control (UAC) on Windows Vista or higher for all those cases where programs of the suite need writing access to the Parts Library. This means that your Unofficial folder should preferably have the following path:

C:\Users\Public\Documents\LDraw\Unofficial\

Basically you have to copy the parts in the various folders of the archive file to its counterpart in the Unofficial folder, following the below scheme:
Wing 3x3  
   
     
Brick 2x2 Corner
ldrawunf.zip <LDRAWDIR>Unofficial
parts -> Parts
parts\s -> Parts\s
p -> P
p\48 -> P\48
 
     
  NOTE! Unzipping an archive file into an existing directory is an additive process. It is recommended that you clean out or delete the Unofficial directory each time you unzip a new download. Otherwise you risk accumulating files that have later been renamed and will never appear in the official library with that number.

So that your final directory for the unofficial parts looks like this:
 
     
  Screenshot Unofficial Folder
   
  In the next step you're gonna tell MLCad to include the folders in its parts library.  
     
 

Editing the MLCad.ini file

 
     
  Browsing MLCad's root folder you'll come across a file named MLCad.ini, which – among other things - defines the order of scanned folders during the launch of MLCad. 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. Part files with the extension .dat found in the scan will be included in the parts library and - depending on the flag - show up in the Parts Tree and Parts Preview pane. Take notice that this feature is NOT equal to the File > Scan Parts command and therefore will NOT rewrite the Parts.lst file.

NOTE! The start-up of MLCad will be slowed down depending on the number of folders and sub-folders to be scanned.

Time to do a little bit of hacking. If for some strange reasons your installation doesn't come with a MLCad.ini file download it from the MLCad.ini tutorial page.
Brick 1x4
     
  Screenshot "Run as Administrator"                  Brick 1x2
   
  The MLCad.ini file is a simple text file, which supports extended ASCII-code and is editable in an editor or a word-processing program, but since it is stored in the Programs Files (x86) 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 - User Account Control, 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.

Open your MLCad.ini file and browse to the section which starts with [SCAN_ORDER]. Every line must contain just one directory to scan and must have the following syntax:

n = <SHOW|HIDE> [<LDRAWDIR>]["]Pathname["]

If the keyword <LDRAWDIR> is omitted the path is assumed to be an absolute path.
 
     
 
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, which is a really bad idea. In fact you should never, ever put the unofficial library ahead of the official library in the search path. This can potentially break existing models:
  • This can happen because sometimes LDraw.org changes already official files to move code in or out of their parents. Whilst at Parts Update time they ensure that fixes to all dependent files are released together, they won't all necessarily exist on the LDraw Parts Tracker at a particular point in time. The most common case is when an existing official part is subparted to allow for patterning. The symptoms depend on what has been changed and in what order the author adds the new subpart and its parent to the Parts Tracker. If the parent is added first there will be missing surfaces until the subpart is added.
  • If the interface between a subpart and its parent get changed then even adding the subpart first may cause problems if it takes a while to upload all it related parents.
The downside is: Since the scan order in MLCad.ini defines what version of a part you will see, an updated part in the unofficial folder, will only be seen in MLCad if you remove the official version from the ordinary \Parts folder.
Sounds weird? I'll show you my personal settings to get you a clearer picture.
Brick 2x4  
  Brick 2x2
     
  Screenshot MLCad.ini file
   
  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:\Users\Public\Documents\LDraw” the code would be:

3 = SHOW "C:\Users\Public\Documents\LDraw\Unofficial\Parts"
4 = HIDE "C:\Users\Public\Documents\LDraw\Unofficial\P"


It should however never be the case since the <LDRAWDIR> keyword gets defined as environmental variable by the LDraw All-In-One-Installer during installation. Before you start defining absolute paths it is might worth investigating what's wrong with your environmental variable.

NOTE! Opening the MLCad.ini file shipped with the LDraw All-In-One-Installer or downloading it from this website you will notice that those directories are already included, but have been commented out. To activate the scan just delete the semicolon in front of those two search paths (don't forget to run your editor as administrator).

Save the file and launch MLCad. The Parts Tree as well as the Parts Preview Window should now contain the unofficial parts and can be used like any other part.
top  
     
  Page 1 2 Next>
  Brick 1x4
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.