Compare 2 files for BOM - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html) +--- Thread: Compare 2 files for BOM (/thread-26115.html) |
Compare 2 files for BOM - Jaco van der Molen - 2022-03-14 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 RE: Compare 2 files for BOM - Roland Melkert - 2022-03-14 (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/ RE: Compare 2 files for BOM - N. W. Perry - 2022-03-15 LDInspector is quite good for this, if I understand the problem correctly. RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 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 example output for set 603: Code: ###---###---### /home/smf/omr/603-1 - Sidecar.mpd I hope LDInspector helps solving your question. If you like to have any other text output format, please let me know. RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-15 (2022-03-15, 7:27)Stefan Frenz Wrote: LDInspector way with GUI (needs Java>=11+JavaFX): 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... RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 (2022-03-15, 8:10)Jaco van der Molen Wrote: How do I start LDI with GUI? Sorry, I have no idea... Thanks for giving a try. The error message means that the virtual machine class loader did not find the required javafx package. This should not happen after using the installer, I'm sorry. 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) RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 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). RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-15 (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. RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-15 (2022-03-15, 10:51)Stefan Frenz Wrote: Thanks for giving a try. 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. RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 (2022-03-15, 13:48)Jaco van der Molen Wrote: OK, I think I need to install Java11 and JavaFX then. I'm very sorry for this. 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". 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 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. RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 (2022-03-15, 13:59)Jaco van der Molen Wrote: 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. Ok, that's exactly what should lead to running a LDInspector instance. I need to search some Windows PC... Need to re-activate that first... RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-15 OK, I ran the installer again. No errors. It downloaded and extracted a bunch of stuff and I ended up with a 249 Mb folder jdk-13.0.2 and files install_win.bat ldinsp.jar run.bat Running run.bat still gives the error: Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found, required by LDInspector RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 Thanks. So everything went well on downloading, and something may be wrong on start-file-creation. My Windows is updating... I will check the Windows installer and hopefully find something... RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-15 (2022-03-15, 14:25)Stefan Frenz Wrote: Thanks. So everything went well on downloading, and something may be wrong on start-file-creation. Thanks! Looking into the run.bat file and reading it, I noticed you reference to a javafx-sdk-13.0.2 which is not present after running the installer. Only jdk-13.02. There is no javafx-sdk-13.0.2 folder, so I thought that might be the problem? I moved the jdk-17.0.2 folder and javafx-sdk-17.0.2 I download before and made some adjustments to the run.bat commands, now reading: @echo off cd /d %~dp0 jdk-17.0.2\bin\java --module-path .;javafx-sdk-17.0.2\lib -m LDInspector/ldinsp.guifx.starter.LDIGuiStarter %* This resulted in running LDInspector! Now to configure and get things running. RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-15 (2022-03-15, 14:34)Jaco van der Molen Wrote: Thanks! GOT IT! LDInspector runs and I was able to compare my 2 files and even create a partslist with the extra parts needed and a list of parts no longer needed. This is a fantastic tool!!! Thanks so much Stefan. RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 (2022-03-15, 15:11)Jaco van der Molen Wrote: GOT IT! Thanks Jaco for testing and reporting. I'm very glad that LDInspector was useful. In the meantime, my Windows machine has updated, and the problem seems to be a failed jfx download, the Microsoft internal download tool bitsadmin says: Code: ERROR CODE 0x80200013 Maybe I have to redesign the Windows installer. RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-15 (2022-03-15, 14:34)Jaco van der Molen Wrote: There is no javafx-sdk-13.0.2 folder, so I thought that might be the problem? Yes. This was the problem, caused by BITSADMIN refusing to download the JavaFX package. Now the download is done via curl (seems to be available on Windows since 2008?), the Windows installer is updated. Thanks Jaco for testing and reporting. RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-16 (2022-03-14, 21:15)Jaco van der Molen Wrote: I have this big model of 12000+ bricks I am working on. OK, so LDInspector can do this perfectly. @Stefan: can you export a partslist to Excel, or some CSV format (or any other list BL wishlist for example)? RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-16 (2022-03-16, 6:47)Jaco van der Molen Wrote: @Stefan: can you export a partslist to Excel, or some CSV format (or any other list BL wishlist for example)? There is already a button "Export as XML" to export to Bricklink format. Unfortunately, there are many parts that have different numbers in LDraw or Bricklink. I don't have a solution for this difference, so at the moment the list has to be uploaded and reported errors have to be fixed manually. I will add another button "Export to CSV" and would add the following columns: color code, LDraw-Part-Number, amount, color name, part name like in Code: 0;3004;1;Black;Brick 1 x 2 Would this meet your requirements or should I add/remove some information? RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-16 (2022-03-16, 8:01)Stefan Frenz Wrote: There is already a button "Export as XML" to export to Bricklink format. Unfortunately, there are many parts that have different numbers in LDraw or Bricklink. I don't have a solution for this difference, so at the moment the list has to be uploaded and reported errors have to be fixed manually. Ok, no problem for the difference in numbers, (I know ;-) but I cannot find the button to export. Please point me to it? The CSV export you propose would be ideal! RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-16 (2022-03-16, 10:34)Jaco van der Molen Wrote: I cannot find the button to export. Please point me to it? The csv-export is added in the just now uploaded current version. Please replace your ldinsp.jar file with the current one or start the installer after removing the old file (should download only the new jar and leave jdk/jfx untouched). For all items LDInspector is capable reading, there is the "Item" tab with "Export as PBG", "Export as XML" and the new "Export as CSV" (pic 1). I added another way in the "PartList" tab via mouse right click in the column header and then "Export ..." which even removes the previously required intermediate step if you want to export some calculated value (old way: create PartList from column, click new item on the left, then export on the Item tab). RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-16 (2022-03-16, 12:57)Stefan Frenz Wrote: The csv-export is added in the just now uploaded current version. Please replace your ldinsp.jar file with the current one or start the installer after removing the old file (should download only the new jar and leave jdk/jfx untouched). Ah yes. Never expected it to be there, neither noticed it when right clicking the column ;-) The export works fine, but now the description of brick 3001 says "null". (see https://forums.ldraw.org/thread-23882-post-45311.html#pid45311) Follow up of this question is if you can export the whole list as one CSV? So this Becomes something like this: Code: partName,partDescription,colorId,colorName,CS,C1,Total With no null bricks? And columns in order like in the GUI (so kind of a WYSIWYG dump from tabluar data) RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-16 (2022-03-16, 13:35)Jaco van der Molen Wrote: And columns in order like in the GUI (so kind of a WYSIWYG dump from tabluar data) I just updated the current version again, please check the new "Export table" button on the PartList tab if it meets your suggestion. It should export your complete table into a single CSV (the "total" column is not added automatically). RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-16 (2022-03-16, 14:24)Stefan Frenz Wrote: I just updated the current version again, please check the new "Export table" button on the PartList tab if it meets your suggestion. It should export your complete table into a single CSV (the "total" column is not added automatically). Oh great! I can simply add a column and let Excel do the math to calculate the difference ofcours. Though I'd like the columns to be in the order as they are shown on screen or perhaps even moveable in the GUI. The export is now [colorId] [partName] [colorName] [partDescription] [CS] [C1] The information on screen is in this order [partName] [partDescription] [Color representing dot] [colorId] [CS] [C1] so the export should be in that order too? Futhermore and nice feature would be to be able to sort the comlums A>Z / Z>A when clicking the header. Another suggestion would be this: Move "Export parts list for external processing." before the buttons Or even perhaps change to "Export parts list for external processing as:" and then only the buttons PBB, CSV and XML and perhaps what's more to come? Like so: Change.png (Size: 61.65 KB / Downloads: 34) Bug (?): Pressing either button (PBB, CSV and XML) adds the letters "PL " in front of the full path you wish to save to. Example, save to: PL C:\LEGO\Models\mymodel.csv should be C:\LEGO\Models\mymodel.csv RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-16 Thanks for the suggestions! I will re-order the columns, you're right: having them in the same order as in the GUI will reduce irritation (the current ordering on export is due to the command line tool which is completely independent). Re-ordering of export-buttons on the Item tab is an easy one. The "PL" prefix is added intentionally, but it seems that Windows does not accept my intention. Exporting the part list of "mymodel.mpd" should result in a file named "PL mymodel.csv" or "C:\LEGO\Models\PL mymodel.csv", but of course not "PL C:\LEGO\Models\mymodel.csv". I will remove this, too. The table-sorting-option on the PartList tab is added to the ToDo list, but I have to think about a multi-order-concept (as clicking only on the color header will not result in a fully defined order). Hmm. Maybe this will take some time. Thanks again for your feedback, I really appreciate it. RE: Compare 2 files for BOM - Jaco van der Molen - 2022-03-17 (2022-03-16, 15:25)Stefan Frenz Wrote: Thanks for the suggestions! Great. I look forward to next updates. RE: Compare 2 files for BOM - Stefan Frenz - 2022-03-17 (2022-03-17, 6:49)Jaco van der Molen Wrote: Great. I look forward to next updates. Next update is online. The discussed four points should be implemented. Every feedback or bug report is appreciated. |