A Variable table allows you to create, view, and edit variable information in the current Part Studio or Assembly. The Variable table is located on the right side of the graphics area with the BOM table, Configuration panel, Exploded views, and Named positions.

Use the Variable table to create variables and change the value of a variable, even when the variable is used in a Part Studio or Assembly feature.

See Variable Table (Part Studio) for information using a Variable table in a Part Studio tab.

Creating a Variable table

The Variable table icon is located on the right side of the graphics area:

  1. Click Custom tables icon to the right-side of the graphics area (below the View cube):

    Accessing the Variable table panel

    1. The Variable table panel opens.

      Variable table from an Assembly tab

  2. Select Create Variable Studio from the dropdown at the bottom of the panel:

    Insert and Create Variable Studio options

    1. A new Variable Studio tab is created in the document workspace, and the Variable table is ready for input in the panel:

      New Variable table created

  3. Type a name for the variable in the Name field. The Variable name must be a FeatureScript identifier: an initial letter or underscore followed by alphanumeric or underscore, without spaces.

    Press Enter (or tab). A variable type and value appear. (Click in the Name cell to change the name, if necessary):

    Variable table

  4. Select a type, and enter a value. You can also (optionally) enter a description.

  5. Repeat as necessary to create all the required variables.

To edit a variable type and value, click the down arrow next to the Variable type for a given variable: select a new type and supply a new value. Each entry is saved:

Variable type dropdown selection Variable table populated with variable data

Inserting a Variable table

  1. Select Insert Variable Studio from the dropdown at the bottom of the panel.

    Insert Variable Studio

  2. In the Insert Variable Studio dialog that opens, select the Variable Studio to insert from this or another document:

Insert Variable Studio dialog

Variable Studios inserted from other documents create references to those documents, and are read-only in the inserted table.

When inserting a Variable table or variable from another document, the other document must have a version that contains the variable. If no version exists, you are prompted to create one before proceeding:

Insert Variable Studio from other documents

Variable table options

Click the ellipsis to the top right of the table to access the following options (options vary depending on whether the Variable Studio or variables are created or inserted — referenced — from this or another document):

Ellipsis to access Variable table options

  • Copy table - Copies the table to the clipboard. Paste and edit the data in a spreadsheet program outside Onshape, copy the data from the spreadsheet to the clipboard, and paste the data from the clipboard back into the Variable table cells or rows.

  • Header rows are read only. The Copy table command copies them to the clipboard, but data cannot be pasted into them from the clipboard.

  • Switch to Variable Studio [x] - Opens the current table's related Variable Studio tab.

  • Open linked document - Opens the document that contains the originating Variable Studio.

  • Update linked document - Opens the Reference manager to change the Variable Studio reference to a different version within the same document or a different document.

  • Move up/down - Moves the table above the previous table in the panel or below the next table in the panel, respectively.

  • Edit reference - Opens the Update Variable Studio dialog where an alternate Variable Studio can be selected as the reference.

  • Remove reference - The Variable Studio reference is removed; the table is deleted and removed from the panel.

Variable table context menu

Right-click on a Variable table cell to access the variable's context menu:

Variable table with context menu

  • Delete - Delete the variable and remove it from the table.

  • Move up/down - Move the variable row to a new location, up or down by one row.

Tips

  • Variables defined in the same Variable table must have unique names. If an existing name is used for a new variable, it is auto-corrected, an incremental counter suffix is applied to the end of its name, and a message alerts you to the correction. For example, if Length is used as a variable, entering Length as the name for a new variable results in the variable name auto-corrected to Length_0.

    Variable Studio with an auto-corrected variable name

  • If a variable with the same name exists in two different tables in the panel, the variable in the last table takes precedence, and the variable in the above table is overridden. An override icon is placed next to the variable name in the above table:

    Overwritten variable

  • If you change a variable name in the Variable table, all Features that refer to the variable will be updated to reflect the change.