bomcheck help (section 1)

Introduction

The purpose of of this program is to compare BOMs (Bills of Materials) derived from a CAD program (like SolidWorks) and compare them to BOMs from an ERP database program (like that of SyteLine). The CAD and ERP programs must be able to export to Excel files. BOMs are gathered for comparison from these Excel files.

Basics you need to know

The file names for BOMs that come from the CAD program should be the part no. of the BOM followed by _sw.xlsx. That is, names like 0300-2010-005_sw.xlsx,  093352_sw.xlsx,  and 35K2445_sw.xlsx  are all legitimate file names.  Similarly the names of the files from the ERP database should end with _sl.xlsx. Thus the names will look like 0300-2010-005_sl.xlsx,  093352_sl.xlsx,  and 35K2445_sl.xlsx. The program will match the 0300-2010-005_sw.xlsx file to the 0300-2010-005_sl.xlsx file, and so forth.

A BOM from an ERP database can be a mulilevel BOM. For the BOM to be recognized as a multilevel BOM, a column named "Level" must exist. The Level column gives the relative level of subassemblies within a main assembly. The Level column starts out with "0" for the top level assembly, "1" for parts/subassemblies under the main assembly, "2" for a parts/subassembly under a Level "1" subassembly, and so forth.

A BOM from a CAD program can also be multilevel. For a CAD BOM to be recognized as multilevel BOM, it must have a column named "ITEM NO.". The numbers in that column should look something like this: 1, 2, 3, 3.1, 3.2, 3.2.1, 3.2.2, 3.3, 4, etc..

Tip #1: If two or more underscore characters exist within a file name, like 094433_testBOM_sw.xlsx, the characters between the first and last underscore characters will be ignored. In this case testBOM.

Tip #2: If the ERP BOM is a multilevel BOM (i.e. has a column named "Level"), then any characters proceeding the "_sl.xlsx" characters will be ignored. Instead the part number is obtained from within the Excel file where the part no. for Level 0 is shown.

How to run bomcheck

To run the program from the command line, run like this (assuming you did the pip install bomcheck method do install bomcheck.py to your system):

(If you'd rather have a graphical user interface (GUI), use bomcheckgui instead.) When the above command is run, help info will be shown about required command line arguments.

If you obtain the file named bomcheck.py, which is the source code for bomcheck, you can run bomcheck from within a python shell. Within bomcheck.py there is a function named bomcheck(). Excecute this function to run bomcheck from within the shell. Execute it like this:

(Note: requirements for running from a shell are pandas>=1.2, toml>=0.10, openpyxl>=3.0, and python>=3.11) To see information about arguments used in bomcheck(), do:

Note that if an error occurs when checking your BOMs, or if bomcheck is confused about some data that was entered, a message will be shown that describes the problem. Otherwise look for something you may have done wrong like failing to attach the _sl.xlsx or _sw.xlsx characters to the file name.

Interpreting results

Shown here is an example showing what a few lines of bomcheck's results look like:

assy Item IQDU Q_sw Q_sl Description_sw Description_sl U_sw U_sl
730322 130031 XXXX 1 HOUSING EA
130039 XXXX 1 HOUSING EA
220978 ‒‒‒‒ 1 1 SPUR GEAR SPUR GEAR EA EA
275000 ‒‒‒‒ 0.35 0.35 TUBE TUBE FT FT
380000 ‒‒‒‒ 2 2 BEARING BEARING EA EA
441530 ‒‒‒‒ 1 1 SHIFT ASSY SHIFT ASSY EA EA
799944 ‒‒X‒ 1 1 SHAFT AXLE EA EA
877325 ‒XX‒ 3 1 PLUG SQ. HEAD PLUG EA EA
900000 ‒‒‒‒ 0.75 0.75 OIL OIL GAL GAL
441530 433255 ‒‒‒‒ 1 1 ROD ROD EA EA
500000 ‒‒‒‒ 1 1 SHIFT FORK SHIFT FORK EA EA
K34452 ‒‒‒‒ 1 1 SPRING PIN SPRING PIN EA EA

The columns I, Q, D, and U show Xs if Item, Quantity, Description, or Unit of measure don't match between the SolidWorks BOM and the ERP BOM. Q_sw and Q_sl are quanties in CAD and ERP. Desription_sw and Description_sl are descriptions in CAD and ERP. U_sw and U_sl are U/Ms (units of measure) in CAD and ERP. Shown above, the 1309031 part is in the ERP but not in CAD. Thus the blank space in CAD's pn column. Likewise, 130039 is in CAD but not in ERP

Units of Measure

If a unit of measure (U/M) is not given for a value in the LENGTH column of a SolidWorks' BOM, then the U/M is assumed to be Inches (unless changed in the bomcheck.cfg file). However the U/M can be explicity specified, e.g. 336.7mm. The program will recognize the following abreviations for U/Ms, and only these:

in, inch, ”, ft, ', feet, foot, yrd, yd, yard, mm, millimeter, cm, centimeter, m, meter, mtr, sqin, sqi, sqft, sqf, sqyd, sqy, sqmm, sqcm, sqm, pint, pt, qt, quart, gal, g, gallon, ltr, l, liter.

Units of measure are not case sensitive. So, for example, you can use sqin or SQIN. Also, sq in is not the same as sqin, so sq in will not be recognized.

When the program is run, values will be converted to the U/M shown in the ERP database program. For example, 336.7mm will be converted to 1.10 ft, and 8 pints will be converted to 1.00 gal. Other names that can be substituted for the column name LENGTH in a SolidWorks BOM are: SIZE, Length, L, SIZE, AMT, AMOUNT, and MEAS. (Column names are case sensitive.)

Viewing txt file results with Excel

You can open a txt (text) file with notepad.exe, but the columns will not be properly aligned. To get around this, copy and paste the text from notepad to a blank sheet in Excel. Columns will become aligned. To make column widths fit the text, click the small box located at the left of column header A, then double click on the vertical separator line that is between columns A and B. All column widths will then be adjusted.

make column width fit text

For more information see: Import or export text (.txt or .csv) files - Microsoft Support

(FYI: bomcheck text files are Tab delimited)

ERP BOM vs ERP BOM howto

The bomcheck program has been designed specifically to compare a CAD BOMs to an ERP BOMs. However with a bit of finagaling, it can be used to compare an ERP BOM to an ERP BOM. Here's how:

  1. Extract the two BOMs you wish to compare and save them to Excel files. Use multilevel BOMs. For example, let's imagine you saved them to 101304_sl.xlsx and 089432_sl.xlsx
  2. Rename the first file to 101304_sw.xlsx (or to 089432_sw.xlsx if you wish. I doesn't matter)
  3. Open in Excel the 101304_sw.xlsx file and go to the line that shows level 0:
    Level Item Description Qty Per U/M
    0 101304 DZS 300V TRIPLEX 1.000 EA
    Change the Item there from 101304 to 089432.
  4. Save the Excel file and run the bomcheck program and compare the 101304_sw.xlsx (or 098432_sw.xlsx) and the 089432_sl.xlsx files. (101304_sw.xlsx works because for multilevel ERP BOMs the 101304 portion of the filename is ignored and bomcheck instead gets the Item no. from that shown at level 0.)
  5. When you look at your BOM check results, you won't see number 101304 listed anywhere. Instead look for the number 089432. You'll see the comparison results there. (Subassembly BOMs will, of course, be present also.) The parts, quantities, etc. for the 101304 system will be shown in the "sw" columns where numbers from a CAD file are normally shown.

If you have BOMs that are NOT multilevel, then rename the 101304_sw.xlsx file to 089432_sw.xlsx, and then compare it to the 089422_sl.xlsx file.

drop list & exceptions list

Perhaps you have parts that show in the CAD BOM, and they are not to be shown in the ERP BOM. For example hardware bolts and nuts that are common stock items. These will show up as errors when bomcheck is run. However you can exclude these CAD items from the check. To do this enter these items in what is called a drop list. The list will look something like this:

["3*-025", "3182-*"]

Add as many items to the list as you like. If there are exceptions to this that you would like to account for, then create an exceptions list. Here is an example of an exceptions list:

["3042-*-025", "3182-0000-001"]

The drop and exceptions lists can be activated in three different ways:

  1. Enter your drop and exceptions lists in a bomcheck.cfg file. Then when you run bomcheck from the command line invoke the -d switch. (Run bomcheck --help on the command line to see a list of options.)
  2. When running bomcheck from the command line, enter your drop and excecptions list directly as an option on the command line. E.g. bomcheck --drop ["3*-025"] --exceptions ["3042-*-025"] filename. The -d switch will automatically be invoked. Running this way will supersede values entered into the bomcheck.cfg file.
  3. When running bomcheck via the bomcheckgui program (bomcheckgui is a wrapper for the bomcheck program) go to bomcheckgui's settings and enter your drop and exceptions lists there. Click the "Activate drop list" check box to activate these lists when bomcheck is run. When running this way the drop and exceptions lists in settings supersede those lists in the bomcheck.cfg file.

bomcheck.cfg

Download the file named bomcheck.cfg (download link) that contains settings that you can change in order to alter how the bomcheck program behaves. For example, you can change units of measure, change what column headings that bomcheck recognizes, redirect html links that are used by bomcheckgui's help menu, etc..

Open bomcheck.cfg with a text editor program such as Microsoft's Wordpad.exe. (Warning: different text editors can sometimes place different end-of-line characters in the text, so be carefull of this.) There you will get an explanation how to change different settings.

Place bomcheck.cfg in a directory of your choosing. Then set the location of this file via an argument setting in the bomcheck function (do bomcheck --help to see command line options), or if you are using bomcheckgui, go to the settings section and enter the location there.