First you will want to add a Cost Property to the BOM template:
- Insert a new column where you want the information to appear. The new column must be to the left of the column marked $$END.
- Enter the column heading for the property you want to display in that column, and press Enter. The name appears in the Formula Bar in the Excel toolbar. This column heading does not need to match the custom property name.
- Click the cell to select it, then click Insert, Name, Define and type in the name of the property that you want to appear in this column. This cell name replaces the default alphanumeric cell name that appears in the Name Box in the Excel toolbar whenever you click a cell.
- The cell name is listed in the Names in workbook list for the selected cell. This name must match the name of the property from the part or sub-assembly document, and must not contain any spaces.
- Click Add, then click OK.
- Back in SolidWorks, select the drawing view to use for the BOM and go to Insert > Tables > Excel Based Bill of Materials.
- You can then add equations and rows to the Bill of Material to calculate cost.
Please see Bill of Materials Custom Properties and Bill of Material Overview in the help file for additional information.