Lesson 15: Using Text Files to Add or Modify Design Properties Lesson Objectives After completing this lesson, you will be able to: Use the Export/Import commands Create a Custom Bill-of-Materials Using the Export / Import Properties Command EMA Design Automation 299
Use the Tools - Export Properties and Tools - Import Properties commands to: Export all design properties to a text file Use a spreadsheet editor to add or modify properties Reload the modified file into the design The exported file format is set up as a table with rows corresponding to parts or nets, and columns corresponding to properties. Property values are delimited by tabs. Things to Remember Here are some additional things to remember when editing the export file: The first two rows of the file identify the document as either a design or a library, and, if a design, identify the schematic page that is the source of this information. Do not change or delete these two rows. In each of the subsequent rows, the first two fields contain a keyword and an identifier. Do not change or delete the information in these two fields. When adding new information, do not skip columns. Enter <null> as a placeholder. EMA Design Automation 300
Lab 15-1: Using an Export/Import Properties File Lab Objectives Most of the global editing functions used in this method can now be accomplished using the Property Editor at the Project Manager level. After completing this lab you will be able to: Export part properties View the export file within Excel Edit the export file Import the file Exporting Part Properties 1. In the Project Manager window, click on the design file. 2. Select Tools - Export Properties. The Export Properties window appears. 3. In the Contents section, observe that Part Properties is the default option. This means that all existing part properties will be exported to a text file called lesson10.exp. 4. Click OK. Notice that the lesson10.exp file has been added to the Outputs folder. 5. In the Project Manager window, double click on the.\lesson10.exp file. The exported file is opened in a text editor window. This file contains all the part properties currently in the design. 6. View the file and close the window. (Do not edit here.) Viewing the Export File with Excel 1. Start Microsoft Excel. 2. In Excel, select File - Open. EMA Design Automation 301
3. In the Look in field, navigate to the directory: D:\EMA_Training\Capture\Lesson10 4. Set your Files of type field to All Files (*.*), as shown in the following graphic. 5. Click on the scroll arrow for the File name field to display *.exp in the field window. 6. Select the lesson10.exp file and click Open. a. In the Text Import Wizard - Step 1 of 3 window, click Next. This tells Excel that the export file is a tab-delimited file. b. In the Text Import Wizard - Step 2 of 3 window, click Finish. The export file is loaded into the spreadsheet window. 7. Drag the left mouse button to increase column widths as needed (so you can see the column headers). Editing the Export File DO NOT delete any rows or columns. DO NOT re-arrange the file by sorting any row or column. DO NOT save the file in EXCEL format. EMA Design Automation 302
1. Right click at the top of the PART_NUMBER column, and select Insert from the pop-up menu.. A new column is added before the PART_NUMBER column. 2. Click in the HEADER row at the top of the new column and enter: DESCRIPTION 3. Assign part descriptions as shown in the graphic that follows. EMA Design Automation 303
. 4. Add any other property that you want to bring into the design, or change the values of some existing properties. If you added or edited other part properties, check them as well. 5. In Excel, select File - Close. (Not the File - Save command.) 6. Click Yes to indicate you want to save the Lesson10.exp. 7. Click Yes to indicate you want to retain the.exp file format. 8. Select File - Exit, and No to exit Excel. Importing the File 1. In the Project Manager window, click on the design file name and select Tools - Import Properties. EMA Design Automation 304
2. In the Import Properties window, navigate to the directory: D:\EMA_Training\Capture\Lesson10 3. Select the Lesson10.exp file and click Open. The modified property file is loaded into the design. 4. Select File - Save. Viewing Results 1. Open a schematic page and use the Property Editor to verify that DESCRIPTION properties have been loaded. EMA Design Automation 305
2. When you re done, close the schematic page. The Export/Import Properties technique can also be used to update net properties.. EMA Design Automation 306
Lab 15-2: Customizing the Bill-of-Materials Lab Objectives After completing this lab you will be able to: Open the Bill-of-Materials Change line item definitions within the Bill-of-Materials Create a Custom Bill-of-Materials Save and re-load text header and property lines Open the Bill of Materials 1. Click in the Project Manager window, click on the design file and select Tools - Bill of Materials. 2. (Optional) Click Place each part entry on a separate line (turn checkbox on). 3. Click View Output (turn checkbox on). If you prefer, there is also an option to open the Bill-of-Materials output straight into Excel for a row & column format. Select the Open in Excel instead of the View Output. Changing Line Item Definition 1. In the Header field, specify a line of titles for the columns of data that will be included in the BOM. The full list should read as follows: Item\tQuantity\tReference\tPart\tPCB Footprint\tPart Number\tSupplier\tCost The \t inserts a tab-space between fields of data in the BOM report for both the Header line and the Property String line. What appears in the header line is user defined. 2. In the Combined property string field, specify the properties whose values you want included in the BOM (under the titles you just listed in the previous step). The full list should read as follows: {Item}\t{Quantity}\t{Part Reference}\t{Value}\t{PCB Footprint}\t{PART_NUMBER}\t{VENDOR}\t{COST} EMA Design Automation 307
What appears on the Property String line MUST be specific to the property you want to add...be careful of the spelling, upper and lower case sensitive! Property names must be enclosed in curly braces. The sequence of names corresponds to the sequence of column titles in the Header list. Create a Custom Bill-of-Materials 1. Click OK to display the Bill of Materials report as either a text file or in Excel. Notice the inclusion of the PCB Footprint, Supplier, and Cost data. If desired, you can load this tab-delimited text file into Excel. 2. Close the report. 3. Select File - Close. With the default Bill-of-Materials extractor the Header and Property Sting lines cannot be saved if you wish to switch from one format to another. However, it is recommended that EMA Design Automation 308
you create a simple text file and simply copy and paste the 2 lines from the text file to the extractor. Saving and Re-loading a Text Header and Property Line (Optional) 1. You can also save the Property settings for different text string settings for the Billof-Materials extractor by copy/paste these lines to and from a text file. 2. You can try this by using the supplied Bill-of-Materials-settings.txt text file that accompanies these labs. It can be found in the D: - EMA_Training - Capture directory. The following is the output for a text file. EMA Design Automation 309
The following is the output in Excel. EMA Design Automation 310