Custom LDD part sets
These part sets are defined in simple XML files within the LEGO Digital Designer file hierarchy. Here's how you can find them:
- On Macintosh, control-click the LEGO Digital Designer application and choose "Show Package Contents." Navigate therein to Contents/Resources/database/bricks.
- On Windows if you did the default installation, navigate to here: C:\Program Files\LDD\database\bricks and you'll see the .tix and .png files... for example myRobot seems to be C:\Program Files\LDD\database\bricks\000021LEGOFactoryMyRobot.tix
You will see two files for each part set. One ends in .png, and is the icon to be used for that set within LDD. The other ends in .tix, and defines the set itself.
Structure of a .tix File
A .tix file is an XML file consisting of a single <Collection> element. Within that are two kinds of subelements: <SetItem>, which defines a part type in the set, and <Identifier>, which holds various metadata.
Here is a simple example of a .tix file containing three 1x1 Earth Blue plates (note the structure): <XML> <?xml version="1.0"?> <TabulaXML>
<Collection> <SetItem> <Primitive> <Material> <Identifier> <Origin>MaterialID</Origin> <Name>140</Name> </Identifier> </Material> <Identifier> <Origin>DesignID</Origin> <Name>3024</Name> </Identifier> </Primitive> <Quantity>3</Quantity> </SetItem> <Identifier> <Origin>LddSetName</Origin> <Name>200099LEGOFactoryEarthPlates</Name> </Identifier> <Identifier> <Origin>SetDescriptionEng</Origin> <Name>LEGO Factory - Earth Plates</Name> </Identifier> <Identifier> <Origin>SetDescriptionDeu</Origin> <Name>LEGO Factory - Earth Plates</Name> </Identifier> <Identifier> <Origin>SetType</Origin> <Name>1</Name> </Identifier> <Identifier> <Origin>LaunchDate</Origin> <Name/> </Identifier> <Identifier> <Origin>ExpiryDate</Origin> <Name>20051231</Name> </Identifier> <Identifier> <Origin>Starter</Origin> <Name>1</Name> </Identifier> <Identifier> <Origin>Priority</Origin> <Name>1000099</Name> </Identifier> <Identifier> <Origin>Version</Origin> <Name>1</Name> </Identifier> </Collection>
In this trivial example, the file is mostly <Identifier> tags, but of course in a real part set these are outnumbered by <SetItem> entries.
Within each <SetItem> are two important identifiers: the MaterialID, which defines the part color, and the DesignID, which is the LEGO part number. So in the above example, 3024 is the part number for a 1x1 plate, and 140 is the material ID for Earth Blue. Each <SetItem> also contains a <Quantity> tag defining how many of that part are in the set.
The order in which the different colors of identical bricks appear in the Brick Window, is determined by the order in which they appear in the .tix file. The .tix file does not set the order in which the types of bricks are displayed in the Brick Window, or which category they are found in via the Category Window.
A Perl script can be used to produce a rough TIX file.
Adding Custom Sets (part collections)
You can make your own .tix and .png files, perhaps using the stock ones as examples or starting points, and add them next to the others. These will be available upon your next launch of LDD.
You'll need to know what part number corresponds to what part.
Note for Macintosh users: the bricks folder may be locked, in which case the Finder will ask you to authenticate when you drag in your custom files. Just enter your password, and the files should move successfully.
Custom icons may be created by mimicking the naming scheme used by LEGO and creating a numbered PNG file corresponding to your custom .tix file. For example, if your custom tix is named 000099LEGOFactoryMyCustom.tix, you will need a .png file with the same naming scheme: 000099LEGOFactoryMyCustom.png. The system is actually more flexible, but I won't get into that here. Be sure you have also set the internal names and priority XML tags toward the end of your custom .tix. If you would like to use transparency mask with your icon. Add that mask to the alpha channel of your PNG file. (NOTE: This has been verified--I've done it a dozen times)
|NOTE: It has not yet been verified that doing this allows you to upload designs to LEGO Factory, but certainly, if you set up bag collections, you'd want to stick to just the parts that are in THEIR assortments, and in the right proportions... (remove this notice once it's verified it works!)|
Only a few material IDs have been discovered so far. Here's a good trick for discovering more: make a .tix file containing parts of the same type, but for each one, set the <Quantity> equal to the Material ID. Then launch LDD, and mouse over each part in your custom set. When LDD shows you the quantity available, you can write this down as the material ID along with the corresponding color.
However you need only do that if you want to confirm. The following table has been generated for you already and has all the material IDs that the LEGO factory will accept...
|Material ID||Color Name|
|9||Light Reddish Violet|
|12||Light Orange Brown|
|22||Medium Reddish Violet|
|36||Light Yellowish Orange|
|39||Light Bluish Violet|
|42||Transparent Light Blue|
|47||Transparent Fluorescent Reddish Orange|
|49||Transparent Fluorescent Green|
|105||Bright Yellowish Orange|
|107||Bright Bluish Green|
|110||Bright Bluish Violet|
|112||Medium Bluish Violet|
|113||Transparent Medium Reddish Violet|
|115||Medium Yellowish Green|
|116||Medium Bluish Green|
|118||Light Bluish Green|
|119||Bright Yellowish Green|
|120||Light Yellowish Green|
|121||Medium Yellowish Orange|
|123||Bright Reddish Orange|
|124||Bright Reddish Violet|
|126||Transparent Bright Bluish Violet|
|143||Transparent Fluorescent Blue|
|145||Metallic Sand Blue|
|146||Metallic Sand Violet|
|147||Metallic Sand Yellow|
|148||Metallic Dark Grey|
|150||Metallic Light Grey|
|157||Transparent Fluorescent Yellow|
|158||Transparent Fluorescent Red|
|182||Transparent Bright Orange|
|184||Metallic Bright Red|
|185||Metallic Bright Blue|
|186||Metallic Dark Green|
|187||Metallic Earth Orange|
|191||Flame Yellowish Orange|
|193||Flame Reddish Orange|
|194||Medium Stone Grey|
|196||Dark Royal Blue|
|198||Bright Reddish Lilac|
|199||Dark Stone Grey|
|208||Light Stone Grey|
|212||Light Royal Blue|
|213||Medium Royal Blue|
|224||Light Brick Yellow|
|225||Warm Yellowish Orange|
|227||Transparent Bright Yellowish Green|
|228||Transparent Medium Bluish Green|
|229||Transparent Light Bluish Green|
|230||Transparent Bright Purple|
|231||Transparent Flame Yellowish Orange|
|234||Transparent Fire Yellow|
|236||Transparent Bright Reddish Lilac|
|284||Transparent Reddish Lilac|
|285||Transparent Light Green|
|298||Cool Silver, Drum Lacq|
|1100028||Dark Green with Road|
|1101028||Dark Green with Road Corner|
It's possible that the material IDs will always match the LEGO Color Table at peeron.com. The colors checked so far do match, but it's not yet known whether this is true for all colors.
Material IDs are defined in a separate .tix file located at C:\Program Files\LEGO Software\LEGO Digital Designer\database\ui\tabula.tix.
A Perl script was used to generate the above color list from tabula.tix, shown below. It has structure as follows:
<XML> <?xml version="1.0"?> <TabulaXML>
<MaterialTable> <Material> <Colour> <RGB> <Red>215</Red> <Green>197</Green> <Blue>153</Blue> </RGB> </Colour> <Identifier> <Origin>Description-dan</Origin> <Name>Teglgul</Name> </Identifier> <Identifier> <Origin>Description-deu</Origin> <Name>Ziegelgelb</Name> </Identifier> <Identifier> <Origin>Description-eng</Origin> <Name>Brick Yellow</Name> </Identifier> <Identifier> <Origin>Lego Material ID</Origin> <Name>5</Name> </Identifier> <Identifier> <Origin>Style</Origin> <Name>Plastic</Name> </Identifier> </Material> </MaterialTable>
(Please contribute more material IDs here as you confirm them.)
You'll need to know the "Design IDs" (part ids) of parts for this to work. A similar trick for discovering parts as is given above for material IDs should work.
|LEGO Design ID||LDraw number/Part Name and Peeron Link|
|3024||3024 - 1x1 plate|
In this example, the LDRAW number is the same as the one used by LDD, but this does not seem to be true across the board. In many instances, especially in the case of transparent bricks, LDD uses a different number.
Note: it is known that LEGO sometimes uses different molds for transparent bricks or for bricks that carry plating or coatings, due to wall thickness issues. Since many LDraw numbers are taken from the numbers molded in to the bricks themselves, it makes sense that those correspond there if LDD is using LEGO internal numbers for things.
It appears that a set of files describing each available piece is in this directory: C:\Program Files\LEGO Software\LEGO Digital Designer\database\geometry\. The numbers there also seem to match relevant LDraw numbers.
Unfortunately, these are binary files, so that cannot be confirmed.
(Please contribute more Design IDs here as you confirm them.)