Where To Find This Script

Select Help > Examples from the Menus Type either the example Name listed above or one of the keywords below.

Description

Bill of Materials Script

This project is an example of how to create a Bill of Materials (BOM) using the scripting capabilities of the AWR Design Environment. Twos are loaded in this project. There are two different ways to create the BOM from a design. Each script will write all of the BOM information to an Excel spreadsheet. The first script, "BOMtoExcel_flat" will write all the part information from a user specified schematic to one Excel page. This script will process all of the part numbers down through the design hierarchy. The second script, "BOMtoExcel_hierarchy" will make a new workbook sheet for each schematic and enter the parts for that schematic. This script will them sum the total costs for sub-circuits for the top level schematics.

Running the Bill of Materials Scripts

To see these scripts run, please find the scripts in the project. Please see the Microwave Office User's Guide chapter called Microwave Office API for more information on how to use scripts in the AWR Design Environment. When you run these scripts, they will prompt you for a Parts Database file by opening a file browser window. An Excel spread sheet that has been created with the necessary parts data has been saved in the same directory as this project. Below we have an example set of data for one part.

Part Number Manufacturer Description Cost Per Unit

ATC100B470JW500XB ATC 47pF Chip Capacitors, B Case $1.25

The script matches the part number set for a model in the Parts Database to get the remaining information about the part.

To properly run this example, please choose the Excel file that came with this project. If you hit cancel at this dialog, then the parts database file won't be used.

In this project there are two top-level schematics. The schematic total circuit is the entire circuit without hierarchy. The schematic total with hierarchy is identical to the total circuit except it is built with hierarchy to demonstrate how the script handles these situations. Please see the simulation results to see that they are identical circuits.

If you run the script "BOMtoExcel_flat" you will get a dialog to choose a schematic.

Choose the total_circuit as the top level schematic.

You will then get a dialog asking you to find the parts database file, this is in the same folder as the example.

After you click Open , you will see a new spreadsheet open with your Bill of Materials.

You will see a total cost of $56.59.

Schematic - total_circuit

Schematic Layout - total_with_hierarchy

Scripting Information

Scripts included in the install are configured to run directly from the AWR Design Environment from the Scripts menu.

Scripts that you download must be imported into a project or placed in your global scripts folder to use them. See Working with VB Scripts for information on how to use these scripts.

You can also customize the AWRDE to run scripts from hotkeys, menus, or toolbar buttons. See Working with VB Scripts for more information.

For complete information about the AWRDE API, see the AWRDE API Programming Guide Help in the AWRDE installation. You can also view our Scripting Website for more scripting examples.