The header is a run of type 0 lines at the top of a file. The rules below are those of files in the official parts library; models use as much of them as their program writes.
Header lines in order
| Line | Content |
|---|---|
0 PartDescription | The title. |
0 Name: file.dat | File name, including an s\ or 48\ folder. |
0 Author: RealName [UserName] | The user name may be missing for authors from before the Parts Tracker. |
0 !LDRAW_ORG type (qualifiers) release | File type; release is ORIGINAL or UPDATE YYYY-RR. Unofficial files carry no release. |
0 !LICENSE text | Licence line. |
0 !HELP text | Help text, one line per row, at most 50 characters each. |
0 BFC options | CERTIFY CCW, CERTIFY CW or NOCERTIFY; official parts must use CERTIFY CCW. See back-face culling. |
0 !CATEGORY name | Category. |
0 !KEYWORDS a, b | Search words. |
0 !CMDLINE commands | Command-line options for the part. |
0 !PREVIEW colour x y z a b c d e f g h i | Preview picture settings. |
0 !HISTORY YYYY-MM-DD [User] text | One change. The name may instead be written {RealName}. |
Comments and then the operational lines follow. The library allows no other meta commands in a part header.
Description
Dimensions in a description have at most two decimals, and single-digit numbers are
padded with a leading space. A description ending in (Needs Work) needs a
comment that explains why.
| Prefix | Meaning |
|---|---|
~ | Sub-part, obsolete file or hidden moulding |
= | Alias |
| or ~| | Third-party item |
_ | Physical colour (deprecated) |
File type
| Official type | Unofficial type |
|---|---|
Part | Unofficial_Part |
Subpart | Unofficial_Subpart |
Primitive | Unofficial_Primitive |
8_Primitive | Unofficial_8_Primitive |
48_Primitive | Unofficial_48_Primitive |
Shortcut | Unofficial_Shortcut |
Model | Unofficial_Model (models in the model repository) |
Configuration | – (the colour definition file LDConfig.ldr) |
The format description also names the types File, Submodel
(unofficial only), Element, Sub-part,
Hi-Res Primitive, Alias and the obsolete
Cross-reference. Older files write the line as
0 LDRAW_ORG type release,
0 Official LCAD type release,
0 Unofficial type or 0 Un-official type.
Some old files give no type, so readers should match these lines without regard to case
and with free spacing.
| Qualifier | Meaning |
|---|---|
Alias | Looks identical to another file. An alias may not refer to another alias. |
Physical_Colour | Deprecated. |
Flexible_Section | A section of a flexible part. |
Licence line
Text after 0 !LICENSE | Status |
|---|---|
Licensed under CC BY 4.0 : see CAreadme.txt | Current |
Licensed under CC BY 2.0 and CC BY 4.0 : see CAreadme.txt | Current |
Redistributable under CCAL version 2.0 : see CAreadme.txt | Deprecated |
Not redistributable : see NonCAreadme.txt | Deprecated |
Category
A part or sub-part has at most one category; all the text after
!CATEGORY is its name. Without the line, the first word of the description
is the category, so the line is required when that word is not in this list.
Animal, Antenna, Arch, Arm, Bar, Baseplate, Belville, Boat, Bracket, Brick, Car, Clikits, Cockpit, Cone, Constraction, Constraction Accessory, Container, Conveyor, Crane, Cylinder, Dish, Door, Duplo, Electric, Exhaust, Fence, Figure, Figure Accessory, Flag, Flexible, Forklift, Freestyle, Garage, Glass, Grab, Helper, Hinge, Homemaker, Hose, Ladder, Lever, Magnet, Minifig, Minifig Accessory, Minifig Arm, Minifig Assembly, Minifig Body, Minifig Footwear, Minifig Hand, Minifig Head, Minifig Headwear, Minifig Hips, Minifig Hipwear, Minifig Leg, Minifig Lower, Minifig Neckwear, Minifig Torso, Minifig Upper, Modulex, Monorail, Moved, Mursten, Obsolete, Panel, Plane, Plant, Plate, Platform, Pov-RAY, Propeller, Quatro, Rack, Roadsign, Rock, Scala, Screw, Sheet Cardboard, Sheet Fabric, Sheet Plastic, Slope, Sphere, Staircase, Sticker, Sticker Shortcut, String, Support, Tail, Tap, Technic, Tile, Tipper, Tractor, Trailer, Train, Turntable, Tyre, Vehicle, Wedge, Wheel, Winch, Window, Windscreen, Wing, Znap.
The colour definition file may also give each category an example part:
0 !AVATAR CATEGORY "<category>" DESCRIPTION "<description>" PART <a b c d e f g h i> "<part file>"
Keywords
!KEYWORDS takes a comma-separated list; runs of white space count as one.
It may be repeated, keeping each line to 80 characters or fewer. It should not repeat
words of the part name or the part number. It is used in parts and models only.
Preview settings
!PREVIEW gives a colour, a position and a rotation for the preview
picture, relative to the standard view: the bounding box at the origin and the camera at
latitude 30 and longitude 45 degrees. The colour must be one defined in
LDConfig.ldr. The line is left out when it would be
16 0 0 0 1 0 0 0 1 0 0 0 1.
Moved-to files
A renamed part leaves a file under its old name that refers to the new one:
0 ~Moved to NEW
0 Name: OLD.dat
0 Author: [PTadmin]
0 !LDRAW_ORG Part UPDATE 2020-01
0 !LICENSE Licensed under CC BY 4.0 : see CAreadme.txt
0 BFC CERTIFY CCW
0 !HISTORY 2020-01-01 [PTadmin] Moved to NEW
0 // description
1 16 0 0 0 1 0 0 0 1 0 0 0 1 NEW.dat
0
Model repository headers
The Official Model Repository (OMR) holds models of boxed sets as MPD files, under these extra guidelines:
- The file is named
set[-n] - set name[ - sub-model name]. n separates sets that reuse a number, oldest first. - Each model inside is named
set[-n] - name; an unofficial part carried in the file takes its part number as the name. - Mirrored geometry is strongly discouraged, and a note about a substituted or omitted part is welcome as a
0 //comment.
0 FILE 4896 - Roadster Main.ldr
0 Roadster Main
0 Name: 4896 - Roadster Main.ldr
0 Author: Joe Smith [jsmith]
0 !LDRAW_ORG Unofficial_Model
0 !LICENSE Licensed under CC BY 4.0 : see CAreadme.txt
0 !THEME Creator
0 !KEYWORDS car, convertible
0 !HISTORY 2011-08-01 [jsmith] Initial creation
!THEME names the product theme; it, !KEYWORDS and !HISTORY are optional.