LDraw.org Discussion Forums

Full Version: Compare 2 files for BOM
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi all,

I have this big model of 12000+ bricks I am working on.
Somewhere on the way, I lost some work :-( and had to redo a few things here and there.
Before the loss of work, however, the model was 99% complete and I was able to restore the lost file and thus its BOM.
Finishing the model, there are some changes and additions here and there and I kind of lost what bricks went missing, got replaced, and are not used anymore.

So, my question: Is there a clever way to compare 2 files to see the difference in the BOM?

Thanks!

Jaco
(2022-03-14, 21:15)Jaco van der Molen Wrote: [ -> ]So, my question: Is there a clever way to compare 2 files to see the difference in the BOM?

You could try winMerge to compare the ldraw text files.
https://winmerge.org/
LDInspector is quite good for this, if I understand the problem correctly.
LDInspector way with GUI (needs Java>=11+JavaFX):
1. add files/directory
2. select first file to compare
3. choose PartList tab
4. right click "CS" column header to "Copy row" ==> your first file is now in CS and C1
5. select next file
6.1. manual way: compare CS and C1 directly
6.2. automatic way: right click "C1" column header to "Subtract CS amounts from this row" ==> in C1 is the difference
7. repeat steps 4-6 for more files if needed

[attachment=7667]

[attachment=7668]

[attachment=7669]

LDInspector way with command line (needs Java>=8):
1. use command line "java -cp ldinstr.jar ldinsp.tools.LDITBillOfMaterial HERE_YOUR_FILE" per file
2. compare text output: each step of each contained model is printed separately and summed up in "all" section

example output for set 603:
Code:
###---###---### /home/smf/omr/603-1 - Sidecar.mpd
###---### Step 1
0;3004;1;Black;Brick  1 x  2
0;3022;1;Black;Plate  2 x  2
0;3815c01;1;Black;Minifig Hips and Legs
1;8;3;Blue;Plate  2 x  2 with 2 Wheel Clips Perpendicular
1;3020;2;Blue;Plate  2 x  4
1;3022;1;Blue;Plate  2 x  2
1;3660;1;Blue;Slope Brick 45  2 x  2 Inverted
1;3842a;1;Blue;Minifig Helmet Classic with Thin Chin Guard and Visor Dimples
4;973;1;Red;Minifig Torso
4;3464;3;Red;Wheel Centre with Stub Axles
4;3818;1;Red;Minifig Arm Right
4;3819;1;Red;Minifig Arm Left
7;3024;2;Light Grey;Plate  1 x  1
7;3623;1;Light Grey;Plate  1 x  3
14;3626ap01;1;Yellow;Minifig Head with Standard Grin Pattern (Solid Stud)
14;3633;2;Yellow;Fence Lattice  1 x  4 x  1
14;3794a;1;Yellow;Plate  1 x  2 without Groove with 1 Centre Stud
14;3795;1;Yellow;Plate  2 x  6
14;3820;2;Yellow;Minifig Hand
256;3641;3;Rubber Black;Tyre  6/ 50 x  8 Offset Tread
###---### all
0;3004;1;Black;Brick  1 x  2
0;3022;1;Black;Plate  2 x  2
0;3815c01;1;Black;Minifig Hips and Legs
1;8;3;Blue;Plate  2 x  2 with 2 Wheel Clips Perpendicular
1;3020;2;Blue;Plate  2 x  4
1;3022;1;Blue;Plate  2 x  2
1;3660;1;Blue;Slope Brick 45  2 x  2 Inverted
1;3842a;1;Blue;Minifig Helmet Classic with Thin Chin Guard and Visor Dimples
4;973;1;Red;Minifig Torso
4;3464;3;Red;Wheel Centre with Stub Axles
4;3818;1;Red;Minifig Arm Right
4;3819;1;Red;Minifig Arm Left
7;3024;2;Light Grey;Plate  1 x  1
7;3623;1;Light Grey;Plate  1 x  3
14;3626ap01;1;Yellow;Minifig Head with Standard Grin Pattern (Solid Stud)
14;3633;2;Yellow;Fence Lattice  1 x  4 x  1
14;3794a;1;Yellow;Plate  1 x  2 without Groove with 1 Centre Stud
14;3795;1;Yellow;Plate  2 x  6
14;3820;2;Yellow;Minifig Hand
256;3641;3;Rubber Black;Tyre  6/ 50 x  8 Offset Tread
###---###---### /home/smf/omr/603-1 - Sidecar.mpd / 603-1 - sidecar.ldr (used 1x)
###---### Step 1
1;3020;2;Blue;Plate  2 x  4
1;3022;1;Blue;Plate  2 x  2
###---### Step 2
14;3795;1;Yellow;Plate  2 x  6
###---### Step 3
1;8;3;Blue;Plate  2 x  2 with 2 Wheel Clips Perpendicular
1;3660;1;Blue;Slope Brick 45  2 x  2 Inverted
4;3464;3;Red;Wheel Centre with Stub Axles
256;3641;3;Rubber Black;Tyre  6/ 50 x  8 Offset Tread
###---### Step 4
0;3022;1;Black;Plate  2 x  2
14;3633;2;Yellow;Fence Lattice  1 x  4 x  1
14;3794a;1;Yellow;Plate  1 x  2 without Groove with 1 Centre Stud
###---### Step 5
7;3024;2;Light Grey;Plate  1 x  1
7;3623;1;Light Grey;Plate  1 x  3
###---### sub-all
0;3022;1;Black;Plate  2 x  2
1;8;3;Blue;Plate  2 x  2 with 2 Wheel Clips Perpendicular
1;3020;2;Blue;Plate  2 x  4
1;3022;1;Blue;Plate  2 x  2
1;3660;1;Blue;Slope Brick 45  2 x  2 Inverted
4;3464;3;Red;Wheel Centre with Stub Axles
7;3024;2;Light Grey;Plate  1 x  1
7;3623;1;Light Grey;Plate  1 x  3
14;3633;2;Yellow;Fence Lattice  1 x  4 x  1
14;3794a;1;Yellow;Plate  1 x  2 without Groove with 1 Centre Stud
14;3795;1;Yellow;Plate  2 x  6
256;3641;3;Rubber Black;Tyre  6/ 50 x  8 Offset Tread
###---###---### /home/smf/omr/603-1 - Sidecar.mpd / 603-1 - wheel.ldr (used 3x)
###---### Step 1
1;8;1;Blue;Plate  2 x  2 with 2 Wheel Clips Perpendicular
4;3464;1;Red;Wheel Centre with Stub Axles
256;3641;1;Rubber Black;Tyre  6/ 50 x  8 Offset Tread
###---### sub-all
1;8;1;Blue;Plate  2 x  2 with 2 Wheel Clips Perpendicular
4;3464;1;Red;Wheel Centre with Stub Axles
256;3641;1;Rubber Black;Tyre  6/ 50 x  8 Offset Tread
###---###---### /home/smf/omr/603-1 - Sidecar.mpd / 603-1 - minifig.ldr (used 1x)
###---### Step 1
0;3815c01;1;Black;Minifig Hips and Legs
1;3842a;1;Blue;Minifig Helmet Classic with Thin Chin Guard and Visor Dimples
4;973;1;Red;Minifig Torso
4;3818;1;Red;Minifig Arm Right
4;3819;1;Red;Minifig Arm Left
14;3626ap01;1;Yellow;Minifig Head with Standard Grin Pattern (Solid Stud)
14;3820;2;Yellow;Minifig Hand
###---### sub-all
0;3815c01;1;Black;Minifig Hips and Legs
1;3842a;1;Blue;Minifig Helmet Classic with Thin Chin Guard and Visor Dimples
4;973;1;Red;Minifig Torso
4;3818;1;Red;Minifig Arm Right
4;3819;1;Red;Minifig Arm Left
14;3626ap01;1;Yellow;Minifig Head with Standard Grin Pattern (Solid Stud)
14;3820;2;Yellow;Minifig Hand

I hope LDInspector helps solving your question.

If you like to have any other text output format, please let me know. Smile
(2022-03-15, 7:27)Stefan Frenz Wrote: [ -> ]LDInspector way with GUI (needs Java>=11+JavaFX):
1. add files/directory
2. select first file to compare
3. choose PartList tab
4. right click "CS" column header to "Copy row" ==> your first file is now in CS and C1
5. select next file
6.1. manual way: compare CS and C1 directly
6.2. automatic way: right click "C1" column header to "Subtract CS amounts from this row" ==> in C1 is the difference
7. repeat steps 4-6 for more files if needed

LDInspector way with command line (needs Java>=8):
1. use command line "java -cp ldinstr.jar ldinsp.tools.LDITBillOfMaterial HERE_YOUR_FILE" per file
2. compare text output: each step of each contained model is printed separately and summed up in "all" section

I hope LDInspector helps solving your question.

If you like to have any other text output format, please let me know. Smile

Hi Stefan,

This looks like the thing I need.
How do I start LDI with GUI? Sorry, I have no idea...

[Add/Edit] I tried the installer which downloads and apparently installs a bunch of things, but then I get:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.graphics not found, required by LDInspector

So I understand that I need Module javafx.graphics but now I am unsure how to get that and install.

Java is one big grey area for me...
(2022-03-15, 8:10)Jaco van der Molen Wrote: [ -> ]How do I start LDI with GUI? Sorry, I have no idea...

[Add/Edit] I tried the installer which downloads and apparently installs a bunch of things, but then I get:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.graphics not found, required by LDInspector

Thanks for giving a try. Smile 

The error message means that the virtual machine class loader did not find the required javafx package. Sad  This should not happen after using the installer, I'm sorry. Sad  Looks like the installer is broken or the packages I'm referring to are replaced.

To track it down could you please tell:
- which OS you use
- how LDInspector was started (command line / GUI, which directory)
PS: For the LDInspector GUI package always Java11+JavaFX is required, even for the command line tool. To use the command line tool with Java8, please use the LDInstruction package. The contained program is the same, but the packaging differs (this is something I really dislike about Java starting with version 9).
(2022-03-15, 11:03)Stefan Frenz Wrote: [ -> ]PS: For the LDInspector GUI package always Java11+JavaFX is required, even for the command line tool. To use the command line tool with Java8, please use the LDInstruction package. The contained program is the same, but the packaging differs (this is something I really dislike about Java starting with version 9).

OK, I think I need to install Java11 and JavaFX then.
This seems a bit complicated even for me.
Though I concider myself fairly technical and capable to work with computers and stuff, I have been spending the whole morning now to even begin to understand what to download and install....

I have a Java installed, a Java SDK and JavaFX SDK but not a clue how to get things running.
(2022-03-15, 10:51)Stefan Frenz Wrote: [ -> ]Thanks for giving a try. Smile 

The error message means that the virtual machine class loader did not find the required javafx package. Sad  This should not happen after using the installer, I'm sorry. Sad  Looks like the installer is broken or the packages I'm referring to are replaced.

To track it down could you please tell:
- which OS you use
- how LDInspector was started (command line / GUI, which directory)

I am on Windows and tried the run.bat file the installer created in a folder where I downloaded the installer and where appartently the installer put a bunch of stuff.
(2022-03-15, 13:48)Jaco van der Molen Wrote: [ -> ]OK, I think I need to install Java11 and JavaFX then.
This seems a bit complicated even for me.
Though I concider myself fairly technical and capable to work with computers and stuff, I have been spending the whole morning now to even begin to understand what to download and install....

I have a Java installed, a Java SDK and JavaFX SDK but not a clue how to get things running.

I'm very sorry for this. Sad  The installer should download Java and JavaFX, extract them at the current location and should then create a batch file (Windows) resp. bash file (Linux) to start it, so hopefully nothing has to be installed manually - and yes, the Java starting philosophy is, hum, "not always self-explanatory".  Wink At the moment the installer should download and use version 13 of Java and JavaFX.

On Linux, the installer output should look somewhat like this (tested right now):
Code:
smf@smfh:~/tmp$ ./install_lin.sh
installing java to /home/smf/tmp/lditmp
--2022-03-15 14:57:32--  https://download.java.net/java/GA/jdk13.0.2/d4173c853231432d94f001e99d882ca7/8/GPL/openjdk-13.0.2_linux-x64_bin.tar.gz
Resolving download.java.net (download.java.net)... 2.22.68.100
Connecting to download.java.net (download.java.net)|2.22.68.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 195812001 (187M) [application/x-gzip]
Saving to: ‘openjdk-13.0.2_linux-x64_bin.tar.gz’

openjdk-13.0.2_linu 100%[===================>] 186.74M  1.44MB/s    in 1m 49s 

2022-03-15 14:59:22 (1.71 MB/s) - ‘openjdk-13.0.2_linux-x64_bin.tar.gz’ saved [195812001/195812001]

jdk-13.0.2/bin/jaotc
jdk-13.0.2/bin/jar
jdk-13.0.2/bin/jarsigner
<snip---many-lines-starting-with-jdk-13---snip>
jdk-13.0.2/lib/server/classes.jsa
jdk-13.0.2/lib/server/libjsig.so
jdk-13.0.2/lib/server/libjvm.so
jdk-13.0.2/lib/src.zip
jdk-13.0.2/lib/tzdb.dat
jdk-13.0.2/release
java successfully installed
installing jfx to /home/smf/tmp/lditmp
--2022-03-15 14:59:25--  https://download2.gluonhq.com/openjfx/13.0.2/openjfx-13.0.2_linux-x64_bin-sdk.zip
Resolving download2.gluonhq.com (download2.gluonhq.com)... 178.128.135.159
Connecting to download2.gluonhq.com (download2.gluonhq.com)|178.128.135.159|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 47108942 (45M) [application/zip]
Saving to: ‘openjfx-13.0.2_linux-x64_bin-sdk.zip’

openjfx-13.0.2_linu 100%[===================>]  44.93M  15.8MB/s    in 2.8s   

2022-03-15 14:59:28 (15.8 MB/s) - ‘openjfx-13.0.2_linux-x64_bin-sdk.zip’ saved [47108942/47108942]

Archive:  openjfx-13.0.2_linux-x64_bin-sdk.zip
   creating: javafx-sdk-13.0.2/
   creating: javafx-sdk-13.0.2/lib/
  inflating: javafx-sdk-13.0.2/lib/libjavafx_font_freetype.so 
  inflating: javafx-sdk-13.0.2/lib/libglassgtk3.so 
  inflating: javafx-sdk-13.0.2/lib/javafx-swt.jar 
<---snip---many-lines-starting-with-inflating---snip>
  inflating: javafx-sdk-13.0.2/legal/javafx.media/libffi.md 
  inflating: javafx-sdk-13.0.2/legal/javafx.media/gstreamer.md 
  inflating: javafx-sdk-13.0.2/legal/javafx.media/applecoreaudio.md 
  inflating: javafx-sdk-13.0.2/legal/javafx.media/ADDITIONAL_LICENSE_INFO 
jfx successfully installed
java and jfx ok
downloading current version of LDInspector
--2022-03-15 14:59:29--  http://fam-frenz.de/stefan/ldinsp.jar
Resolving fam-frenz.de (fam-frenz.de)... 217.160.0.151
Connecting to fam-frenz.de (fam-frenz.de)|217.160.0.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 494023 (482K) [application/java-archive]
Saving to: ‘ldinsp.jar’

ldinsp.jar          100%[===================>] 482.44K  --.-KB/s    in 0.1s   

2022-03-15 14:59:30 (3.53 MB/s) - ‘ldinsp.jar’ saved [494023/494023]

run script created, please execute run.sh to start LDInspector

After that, starting LDInspector should be easily done via
Code:
smf@smfh:~/tmp$ ./run.sh

At the first start, the GUI should ask for your LDraw path and basic configuration.

Which version (Windows, Linux) did you try, was there any error in the script? Edit: found your post above.
Pages: 1 2 3