8

I've created a MOC using Stud.io, bought the pieces and built it. Since it was unstable I've changed the model in Stud.io, and now I would like to buy just the pieces I've added. I could compare both version of the model manually to get the differences, but that would be somewhat cumbersome and error prone, so I'm wondering if there is some tool to compare two models, or two parts lists?

I'm thinking about something that could for example take two BrickLink XML files, and produces a new XML containing only the parts (and amount) not present in the older version.

chicks
  • 5,255
  • 3
  • 24
  • 52
Christian
  • 333
  • 1
  • 6

4 Answers4

8

Since there doesn't seem to be a tool, I've written my own one. In case anyone else want to use it, check it out here: https://github.com/ChrZae/bricklink-xml-diff

Take care tho, it can only really process the XML generated by Stud.io, the XML-format itself has more fields which I didn't care about (also no guarantees it will always work correctly).

Christian
  • 333
  • 1
  • 6
  • Thanks for automating this. It'd be great if your README explained how to use it, what the requirements were, and whether filing github issues is the preferred support venue. https://gist.github.com/PurpleBooth/109311bb0361f32d87a2 – chicks Mar 29 '18 at 12:05
3

I would use the winmerge tool:

http://winmerge.org/downloads/

XML files are text files. You can compare two text files with Winmerge and extract the differences... some manual labor would be involved if the same part is present in both lists but with different amounts, but I would expect this to be all rather straight forward...

Michael Verschaeve
  • 11,064
  • 1
  • 25
  • 62
  • Thanks, but I would consider that finding the differences manually, too. – Christian Mar 28 '18 at 10:50
  • @Christian all solutions are in some part manual. Of course, making this part smaller can be desirable. On the other hand, WinMerge is tried and true, deals really well with whitespaces etc, and using it allows user to correct mistakes on the fly. Your program may be all nice and fine, but it didn't have all that many testers. – Mołot Mar 29 '18 at 08:37
  • @Molot, on the other hand, parsing and writing XML is not that hard, there are tried and tested libraries... – Michael Verschaeve Mar 29 '18 at 08:45
  • @Mołot true, its bareley tested, but then again I trust myself even less when it comes to comparing 2K parts and finding the 200 differences and writing them up without making a single mistake, however good the diff-tool is ;) – Christian Mar 29 '18 at 09:03
  • @Christian winmerge can generate pretty good diff files. Then you'll have just a list of xml blocks added and removed. Rather straightforward, and I did it on things much more "important" (in the terms of $) than something like 200 bricks – Mołot Mar 29 '18 at 09:06
  • @Mołot how do you deal with parts that are out of order? The XML generated by Stud.io is not sorted, so the same part may turn up at totally different positions in the file. So unless winmerge knows how to sort the xml, you would have to find these all yourself? – Christian Mar 29 '18 at 09:10
  • @Christian there is an option to detect moved blocks. See this screenshot: https://i.stack.imgur.com/90Whq.png – Mołot Mar 29 '18 at 12:08
1

I usually use Rebrickable to compare whatever I need.

First, you need to create two custom lists (My LEGO > My Custom Lists). Import tool supports "BrickLink Stud.IO files" so no conversion is required.

Once you got your lists sorted you need to compare them using "Compare sets" feature (Sets > Compare Sets). While the name suggest only sets could be compared in reality functionality is broader - you can compare custom lists as well. You will then be presented with the result, where "unique" parts are the ones that does not exist in compared model. You can also export this list for further use.

Alex
  • 23,120
  • 2
  • 41
  • 93
0

A little bit late to the party but I made this notebook to compare your brick: https://github.com/mhoangvslev/bricklink_tool_suites/blob/main/Bricklink_Compare_Parts.ipynb

I simply use 2 part lists downloaded from Bricklink.

Feel free to modify it to your need.