I should have kept up with this more during the down time, but I didn’t. So we’re here.

Getting the gang back together

After I had all of the pieces sorted and sort of organized, I started repackaging all of the sets I had instructions for. Mostly to find which pieces had gotten lost over the years and moves. I used Bricklink as my primary source for this information. After I had packaged all of that, I started working on sets I no longer had the instructions for. This is more difficult by the nature of going solely off of my memory. Some sets, like the Sprint Racer (6503) and Precinct Cruiser (6506) have relatively strong memories attached to them. Some were recognizable by certain pieces that were relatively unique to that set. I did manage to find a set based solely on a combination of parts left behind.

And even still, there was a significant amount of “loose pieces”. There’s at least one set that I had no interest in rebuilding or finding out even if I could. An old McDonald’s Happy Meal set, the Land Laser (1646) if you’re interested. About $1 worth of basic bricks.

I’m bad at reading the internet

Once I had everything bagged, I placed orders for the pieces I believed was missing. Plus extras. Just in case. When those pieces started coming in, I started building. And also eventually disassembling. Displaying everything for a few days at the very least. But everything is going to go back into drawers eventually.

But as I was building, I quickly learned that I often skipped pieces or misread colors or numbers. Often pulling light grey for dark grey or vice versa. There were times when I had to go back and grab something from a drawer only to find out that it was the last of it.

Then there were the times when I put too many. Probably reading the next row’s number for the current part. So there are probably cases where I’ve ordered parts I don’t even need. That’s ok. I’m ordering my extra parts from Bricklink, so it’s like recycling. The more plastic that’s in my collection, the less that’s in the ocean or something.

Label what’s left

What’s the point of having all of these bricks in cabinets if you can’t find anything. It was one of the bigger issues when repacking all of the sets, looking for things. So I got to labeling. I used the labels from Brick Architect. Mostly good, but I there are some notable exceptions. Or at least parts I couldn’t find in his set. On the site’s recommendation, I got the Brother P-Touch BT610, a few label cartridges, and the P-Touch Editor software.

I spent way more time than I’d care to admit cutting and pasting label files to get just the pieces I had in drawers to print rather than the whole sets. I also printed pieces I know I have as well. Then there are the “misc” drawers as well. Drawers with just hair pieces or various accessories, things where you can’t justify an entire drawer for a single element.

Due to the layout of the drawers, I think it would be helpful to have the labels on the pull as well as the front. As the pulls are at an angle where looking down at them is convenient. But that would mean printing all of those labels again. Which was a pain.

Enter programming

Well, what if we could just check off what labels we wanted and have the computer splice all the labels for us. We could probably do that if we could read and write the special label file the P-Touch Editor uses. Off to the internet we go. After discovering that LBX is also a Visual FoxPro file extension, we stumbled upon some useful information. Brother decided to do what so many others have done before and just slap a custom extension on an archive.

You can see this in all of the Office products. Any Office file that ends in “x” is a zip file containing files that make up the overall file. For example, a DOCX file is a zip file with several XML files, image files, etc used to make up the Word document. Apple’s APP files are special archives as well. You can open them as folders and explore their contents. You can even edit the files in place.

LBX files are zip files that contain all of the necessary information to reproduce a label or series of labels. Two files seem to be required, the label.xml and prop.xml files. Beyond that, there are other files named Object0.png to ObjectN.png depending on how many images your label has. The file prop.xml seems rather boilerplate-y. I’ve not modified it at all and I’ve just included it as-is in my test files.

The label.xml file is the workhorse. It contains an XML document that basically tells you where everything goes and what it is. Text labels use a <text:text> tag and images use a <image:image> tag. The only thing that’s a bit of a bother is that it seems everything is expressed in points. X/Y coordinates, heights, widths, etc. That’s going to be something to keep in mind when it’s time to splice things.

First lessons

First thing I tried to do was to manually edit a set of labels. Just rip out a picture and a label from another file and put it in a new file. Then zip it up, rename it, and open it in the editor. I learned a few things.

First, compressing files from Apple’s Finder will add some extra files and folders. And the P-Touch Editor does not like that at all. I haven’t tried to put in other extraneous image or XML files, but I know it does not like __MACOSX and .DS_Store. Using zip from the terminal gets around this. And creating the archive programmatically won’t have this issue, so it was more annoying than anything.

Second, the images can be named anything. It doesn’t matter. As long as the <image:image> references the correct name, it’ll show up.

What to do now

I know how to read and extract the bits of XML and the images for all the labels in the archive now. The next step is to actually extract it, store the bits in files, then select the individual bits I want, splice them together in a file, adjust their position as necessary, then archive the new file.

It might be possible to read/render the files themselves and do everything sort of in place. But first I want to get something that works.

By toast