# bomcheck help

- Introduction
- Basics you need to know
- How to run bomcheck
- Interpreting results
- Units of Measure
- bomcheck.cfg
- Troubleshooting

## Introduction

The purpose of of this program is to compare Bills of Materials (BOMs) derived from a CAD program (like SolidWorks) and compare them to BOMs stored in an ERP database program (like that of SyteLine). The CAD and ERP programs must be able to export to excel files because that is where this program gathers BOMs from for comparison.

## 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. The names of the files from the ERP database will 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 file can contain a mulilevel BOM. For a BOM from the ERP program to be recognized as a multilevel BOM, a column named "Level" must exist (can be altered with bomcheck.cfg) that gives the relative level of a subassembly to the main assembly. The Level column starts out with "0" for the top level assembly, "1" for part/subassemblies under the main assembly, "2" for a part/subassembly under a Level "1" subassembly, and so forth. From the CAD program, it is similar, but item nos. indicate the Level, e.g. item nos. like 1, 2, 3, 3.1, 3.2, 3.2.1, 3.2.2, 3.3, 4, etc., where item 3 is a subassembly with parts under it.

Column headers of BOMs (e.g. ITEM, QTY, DESCRIPTION, etc.) may vary from company to company. There is a file that you can configure that may be of help. See the file named bomcheck.cfg.

## How to run bomcheck

To run the program from the command line, run like this:

- `bomcheck`

When the above command is run, help info will be shown about required command line arguments. Another way of running bomcheck is by using the program called Jupyter Notebook. Enter this in a JupyterLab cell, and hit Shift-Enter to run the cell.

- `import bomcheck as bc`
- `bc.bomcheck(arg1, arg2, ..., argN)`

To see what arguments (arg1, arg2, ...) that bomcheck takes, in Jupyter Notebook, on the line showing "bc.bomcheck()", hit Shift-Tab. (The cell must have been ran first). Either that or create a new cell and run:

- `help(bc.bomcheck)`

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 or _sw characters to the file name.

Tip: If the SyteLine BOM is a multilevel BOM (has a column named "Level"), then the name of the Excel file for that BOM is irrelevant as long as it has the _sl characters attached. In this case part numbers of multilevel SyteLine BOMs are extracted from the BOM itself and not from the file name. So then a file name like 094433_initial_sl.xlsx will work, or even a name like mybom_sl.xlsx will work.

## Interpreting results

Shown below is an example of a few lines of what a bom check looks 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 SolidWorks and the ERP. Desription_sw and Description_sl are a comparison of descriptions. U_sw and U_sl are a comparison of units of measure. The 1309031 part is in the ERP but not in SolidWorks, thus the blank space in columns for the SolidWorks category. Likewise, 130039 is in SolidWorks, but not in the ERP BOM

## 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:

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.

When the program is run, values will be converted to the U/M given 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. Names are case sensitive.

## 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. Open bomcheck.cfg with a text editor program such as Microsoft's Wordpad. There you will see settings that can be changed.

Place bomcheck.cfg in a directory of your choosing. Then set the location of this file via an argument setting in the bomcheck function, or, if you are using bomcheckgui, go to the settings section and enter the location there.

## More about file names and file comparisons

Already mentioned above about file names is that they should be names like 093352_sw.xlsx. Bomcheck will recogize the characters 093352 from the file name as being the top level part no. for that BOM. However if the name is something like 093352_083752_sw.xlsx, bomcheck will ignore the characters between the two underscores, in this case 083752, and yet bomcheck will still use the 093352 as the part no. for the BOM.

Where this might come in handy is if you have several BOMs in SolidWorks (SW) that are likely candidates for a BOM you have put together in SyteLine (SL). You can find out which comes closest to your SL BOM. For example you have SW BOMs 087345, 074333, and 097266; and the SL BOM you wish to compare them against is 101555. What you can do is name your SW files as 101555_087345_sw.xlsx, 101555_074333_sw.xlsx, and 101555_097266_sw.xlsx. Then you do your comparison. Bomcheck will use the first portion of the name (101555) for checking. The second portion, e.g. 087345, will help you keep track of what part no. the BOM is actually for.

Something else you can do with program is to compare one SL BOM against another SL BOM. To do this, give one of the SL BOMs a name ending with _sw.xlsx, even though it isn't an actual SW BOM. You can use the two underscores method mentioned above to help you keep track of the actual origin of BOMs.

As mentioned above, bomcheck determines the part no. of the BOM from its file name. Something to note however is that this is not always the case. If a BOM comes from a multilevel SL BOM, then the top level part no. comes from within the BOM file itself. The part no. used is where the level is 0 in the column named Level.

Something that the bomcheck program cannot do is to compare a SW BOM to another SW BOM. The reason this cannot be done is because the SL BOM needs to contain a U/M column for the program to function properly.