Reading a Bill of Materials File
Reading a Bill of Materials File
Selecting the file
The initial Bill of Materials screen is shown in the figure below.To select the Bill of materials file either type the name into the blue box or press the button to bring up the file selection panel.
Until a file name is given the button will not be active. When the button is active, pressing it will scan the file and any comment lines can be selected.
In the image on the right is turned . PRIMER will try to recognise each field by using the column titles.
If is active and label ranges are defined for this part, the renumbering function will be activated. On large models this may slow the read of the BOM considerably. Label ranges may overlap one another.
Two methods are available for handling materials, section or hourglass cards when these are shared by more than one part. The default option will set the part to reference the specified material, etc. It will the only adjust the material title, section properties, etc. if no other part references it. The option will always make a material/section/hgls card with the specified data, creating a new one and ignoring the specified ID, if this proves necessary, because another part refers to that card.
If the material, section and hourglass card for each part are kept unique , both methods will give the same result.
The option if set will over-ride the other. The material on the part card will be set to match the (first found) material of the given name or the given material id if no name is specified. A section card will be created at the same id as the part and the gauge,etc will be updated with the given data. Similarly hourgalss cards will be created if the data is non-zero or one previously existed.
The radio buttons enable/disable error trapping when reading the part number field. In the example bill of materials file in the previous section the line
Part No,Title,Part ID,Material,Supplier,Gauge,Part mass
is not a comment line. If this line is read as an actual line of data an error
could occur as instead of reading a number for the part ID, the string
'Part
ID'
would be read instead.
If
'Skip any lines which have a blank or badly formatted
PID'
is selected, the line would be skipped, a warning printed and the
read will continue.
If 'Treat a blank or badly formatted PID as an error' is selected, this would
be treated as an error and the read will stop.
Comment lines
Once the bill of materials file is selected it is scanned and a preview of the file is shown (the first 50 lines of the file are shown).
This preview can be used to help answer the questions which PRIMER asks. The scrollbars can be used to scroll the preview up and down and from left to right.
The default is not to skip any lines. To skip the comments the switch must be set to If the file does not contain any comments this step can be skipped.
To cancel reading and return to file selection press .
To go on to the next step (skipping specific lines) press
By default comment lines can begin with a $ or a #. Type the characters that you want comments to begin with into the blue box.
In the file preview any lines that will be treated as comments are shown in grey text instead of white text.

Skipping specific lines
In this example we want to skip the line that begins
Vehicle X, Bill of Materials
The default is not to skip any lines containing specific strings. To skip the line the switch must be set to If no lines need to be skipped this is not needed and can just be left at the default value.
To cancel reading and return to file selection press .
To go back to the previous step ( comment lines ) press
To go on to the next step ( selecting delimiters ) press

A line can be skipped that either contains a specific character or a specific string. Type the characters or strings into the blue boxes. Text is case sensitive.
In this example we have chosen to skip any lines that contain the string ' Bill of Mat '.
In the file preview any lines that will be skipped because they contain specific strings or characters are shown in grey text instead of white text.

Selecting delimiters
In this example the fields are separated by commas. e.g.
Part No,Title,Part ID,...
The default delimiter is a comma so this is OK for this example. If the data is separated by another character it can be chosen here. Other buttons are available for common delimiting characters. If your data is separated by a character that is not in the list press the button and type the character in the box. A space cannot be used to separate fields.
To cancel reading and return to file selection press .
To go back to the previous step ( skipping specific lines ) press
To go on to the next step ( defining fields ) press

Defining fields
This panel enables you to choose which columns of the bill of materials to use and what the columns mean. A preview of the bill of materials is shown below.

|
The lines that are going to be skipped are shown in grey
rather than white. The data is shown in columns to make it easier to read.
If there are more than 10 columns a scrollbar is used to view the other
columns. To be able to do anything useful
PRIMER
needs to know which columns you want to use and what those columns mean.
This is done by using the
popup buttons
in each column.
The default action for each field is 'Skip field'. This can be changed by selecting any of the options from the popup. Once an action is selected the column will change colour and 'Skip field' will no longer be shown. A field can be unset at any time. |
For example, if the field for column A is set to be 'PID' it will be coloured dark blue as shown below.
At least the PID and one other field must be selected. The button will not be active until this is done. Once the button is active, will start reading the file and altering the selected fields.
In the following example the CAD part no, Part description, PID, Material title and gauge have been selected.
Only the selected fields will be altered using the bill of materials. In the above example the CAD part no, Part description, Material title and gauge will all be altered as they have been selected. If only the PID and gauge were selected then only the gauge would change.
There are two options to select parts from BOM file to update (see below). 'All in file' option will allow you to update all the parts which have differing information to that in BOM file and 'Subset' will enable The will sketch just the parts that will be modified by clicking . Similarly the will display only the parts that will be modified by clicking .

Listing output
As the Bill of materials file is read messages are copied to a listing window.

This gives information about what the bill of materials is changing. If needed it can be saved to file by pressing the button.