Sharpen your Edge with


SeGuruCool
The Largest Independant Solid Edge Resource Outside UGS



Tutorial
Solid Edge and Excel VLookUp

Tushar Suradkar
www.oocities.org/SeGuruCool

  segurucool @ indiatimes.com


SeGuruCool's Newsletter

Stay updated when new tutorials and articles are posted.

(Note: Do not change first text box)
List Name:
Your Email:


SE Customization eBook
 
  • 79 Seventy-nine chapters
  •  
  • Cust. using VB and VB.NET
  •  
  • Insight Customization
  •  
  • Excel Cust w.r.t. Solid Edge
  •  
  • Coding for Custom Sensors
  •  
  • Coding for Multiple SE versions
  •  
  • XML & BOM-Database connectivity


  •   Download FREE 6 chapters & source code



    In this tutorial you learn :

  • How to prepare a part for parametrization.
  • How to control parameters of the part from an Excel Spreadsheet.
  • How to use the Excel VLookUp function to control a part.

  • Prepare the Part

    In this tutorial we will control the parameters of a flat head rivet as shown in figure.

    Dh = Head Diameter
    Hh = Head Height
    Sl = Shank Length
    Ds = Shank Diameter

    Create the Rivet in Solid Edge Part using a protrusion for the shank and a revolved protrusion for the head.

    By using a revolved protrusion for the head and including the semicircle at the end, we save an extra round feature, had the head been created using a protrusion instead.



    Prepare the Table

    We want to update the part by using the Shank Diameter as the master parameter.
    Here, there is no formula to control the other parameters by changing the Shank Diameter.

    In such cases, we use a table created in MS Excel to control the Master parameter.

    Prepare a table in Excel as shown in figure.

    Fill only the column header and light blue table values.
    Do not fill the dark blue values (12.00 and 1.80) at the bottom.
    The values in the dark blue cells at the bottom will come from the table.

    Fill yellow color in the two cells as shown.
    Do not fill the values in the yellow cells.



    Insert an Image

    You may want to create several such standard parts in future.

    In such cases, place a well-labeled picture of the part just beside the table.

    See figure.

    Download (67 kb) - the Excel 2000 sheet and the Solid Edge 14 part file for the rivet.

    Note : Both files should sit in the same folder to maintain the links.



    Prepare the Variables

    In Solid Edge, kick the variable table to the screen.

    Create four variables as shown.

    Initially, Solid Edge will assign a value of Zero to all.

    Later the values will come from the Excel table.



    Prepare the Table for LookUp

    In Excel, type a value for the Shank Dia Ds in its yellow cell.

    This value should be one from the column for Ds
    (say 7.00 as shown in figure)

    Also, type a value for the Shank Length Sl in its yellow cell.
    The shank length will not come from the table.

    We want Excel to fill the values for the Head Dia Dh and Head Height Hh automatically from the table.

    The values should be the ones corresponding to the value typed in the yellow cell for Ds



    The VLookUp Function

    Click the dark blue cell at the bottom for Dh. This makes the cell active and a thick border appears around the cell.

    See figure.



    Click the = button

    Then click the Edit Formula button on the formula bar.

    This button has the = (equal to) sign on it.

    See figure.



    More Functions

    Now click More Functions from the list.

    See figure.



    All - VLOOKUP

    In the Paste Function dialog, select All in the left list and VLOOKUP in the right list.



    Dialog Obscures Table View

    The VLOOKUP dialog will appear clinging to the Formula Bar and obscuring the table view.

    See figure.



    Move the Dialog

    Move the dialog away by dragging any part of it except the white edit boxes.

    See figure.



    Lookup Value

    By default, the cursor is located in the Lookup_value text box.

    If not, click in the text box for Lookup_value.

    Here you specify which cell's value to lookup in the table for Dh.

    Then click in the yellow cell for Ds

    Its cell address will appear in the Lookup_value text box



    Table Array

    Next click in the Table_array text box and then press and drag to select the entire table range of values.

    Take care that you don't select the header dark blue cells at the top or at the bottom.

    See figure.

    In the Col_index_num, type 2 because you want to look up the second column in the table.

    In the Range_lookup text box, type true and see the meaning in the VLOOKUP dialog at the bottom.

    Click OK in the VLOOKUP dialog.

    Excel will now fill the Dh cell with the corresponding value from the table when you type in input for Ds in the yellow cell.

    Similarly, VLookUp the third column for Head Height - Hh.

    For Hh, the first two and the last inputs will be same, and only the third step Col_index_num will change where you will type 3 since you will lookup the third column in the table.

    Try changing the value in the yellow cell of Ds and use a value from the column for Ds.

    As soon as you move the focus away from the yellow input cell by either pressing Enter or using the arrow keys, the dark blue cells for Dh and Hh will be filled from the table by VLookUp.

    Also, try a value for Ds which is not in its column (say 6.5) and press Enter. Here you will understand the meaning of true as the fourth input in the VLookUp dialog.



    Copy Link from Excel

    Next, link the values for Dh and Hh from Excel to Variable Table in Solid Edge.

    For this, Right click the dark blue cell at the bottom end of the Dh column and select Copy from the menu.



    Paste to Variable Table

    Switch to Solid Edge using Alt + Tab and in the Variable Table that still hangs out there, click the gray button to the left of the variable Dh you created earlier.

    Then right click in the gray box and select Paste Link from the menu that appears.

    The cell from the excel is now permanantly linked to this cell in the Variable Table.

    The value of 0.00 is now gone and is replaced with that from Excel.

    Also the full path and filename of the Excel file along with the cell address will appear as Formula for this variable.

    In case you want to move either the Excel file or the Part file, both should ultimately reside in the same folder so that the link is maintained.



    Maintain Relationship

    The FullName variables in the Variable Table are the Dimension names which actually control the rivet.

    You need to link these to the user variables (the short named ones).

    See figure.

    After doing that you only need to change the Ds ie the Shank Diameter in Excel (Solid Edge may not be running now), and values for Dh and Hh will be looked up from the table and passed on to their counterparts in Solid Edge Variable Table, which in turn are linked to the dimension variables and the part updates !



    Tushar Suradkar     segurucool @ indiatimes.com

    Also Visit :

    CadGuruCool   |   SeGuruCool   |   ProeGuruCool