Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variable Studio

A Variable Studio is a tab that holds a table of variables. Every Part Studio and Assembly of the document can use them in its value fields as #name, and follows them when they change.

  • + › Create Variable Studio in the tab bar makes one.
  • Type a name in the table’s last row, Add variable, then the variable’s value.
  • In another tab, type # and the variable’s name in a dimension or a dialog’s value field.
  • Make variables available to Part Studios and Assemblies, at the bottom, is unchecked while the variables are a draft.

A variable that belongs to one Part Studio or one assembly only can be a Variable feature of that tab instead.

The table of variables

The table has a row for each variable, worked out from top to bottom.

  • Name: letters, digits and _, starting with a letter. Other tabs write it as #name.
  • Type: Length, Angle, Number, or Any, which takes whatever the value gives.
  • Value: a number with its unit, or an expression that may use the variables above it, such as #length / 2.
  • Evaluates to: the result, or in red why there is none.
  • Description: a note about the variable.

Typing a name in the last row adds a Length of 0 and moves on to its value. Click a Name, Value or Description to edit it: Enter or Tab applies what you typed and Esc puts the cell back. Enter in a value moves on to the next row’s value, so a column of values can be typed in one go. Each change is one undo step, and every tab that uses the variable is rebuilt with it.

A value typed as a bare number takes the type’s unit: the document’s length unit for a Length, degrees for an Angle. Click a Type to choose another; a plain value then takes the new type’s unit. Values are written as in a sketch dimension.

A variable can only use the ones above it. A row that can’t be worked out says why, for example #thickness is used before it is defined; move it above this variable, and the rows that use it are in error too. A name used twice belongs to the upper row.

To change the order, drag a row by the handle at its start, or right-click it for Move up, Move down, Insert variable above, Duplicate and Delete. The ✕ at a row’s end deletes it too, as does clicking its handle and pressing Delete.

A table closes and opens with a click on its heading, and ⋯ has Collapse all tables and Expand all tables. Drag the divider between two column headings to resize a column.

Using the variables in other tabs

The variables of every Variable Studio of the document are known in all its Part Studios and Assemblies, as if they were defined above the tab’s first feature.

  • Type # in a dimension’s value box or a dialog’s value field to list them with their values.
  • A Variable feature of the same name in the tab is used instead of the studio’s.
  • When two Variable Studios define the same name, the one in the later tab is used, and both tables say so.

With Make variables available to Part Studios and Assemblies unchecked, no other tab sees the studio’s variables, and a feature that uses one fails because the variable isn’t defined. The bar at the bottom also counts the studio’s variables, its errors and the tabs that use it.

Insert Variable Studio

Insert Variable Studio brings another Variable Studio’s variables into this one, as a read-only table above its own rows, which can then use them.

  • Current document lists the document’s other Variable Studios; a table from one of these follows its studio as it is edited.
  • Other documents opens another document at one of its versions; its variables come in as a copy that stays as inserted.
  • Click a Variable Studio, then keep Whole table checked or check only the variables to bring.
  • Insert adds the table; the ✕ on its heading removes it again.

A studio of this document can’t be inserted twice, nor into a studio that it inserts itself. Another document needs a version, as described in Using one document in another.

A table from a version is headed with its document, studio and version. When that document gets a newer version the heading says Newer version, and Change version… puts the version you choose in the table’s place.

Variables inserted from another document reach the Part Studios and Assemblies together with this studio’s own. Those of a studio of this document reach them from their own studio, when it is available.

Variable

A Variable is a feature that gives a value a name. The features below it in a Part Studio’s feature list, or the mates below it in an assembly’s Mate Features, can use it as #name.

  • The tabs set the type: Length, Angle, Number, or Any, which takes whatever the value gives.
  • Name #: letters, digits and _, starting with a letter.
  • Value: a number with its unit, or an expression that may use the variables above it, such as #width / 2; the result shows below the field.
  • Description: a note about the variable.
  • To use it, type # and its name in a dimension’s value box or a dialog’s value field.

The feature is listed as #name. Double-click it to change its value: every dimension and feature that uses it follows, as one undo step. In an assembly the Variable joins the end of Mate Features, and mate offsets take it.

Typing # in a value lists the variables that can be used there with their values; keep typing to narrow the list, then press Enter or click one. In a Part Studio the list ends with New variable…, which makes a Variable above the feature you are editing, holding the value the field had, and puts its name in the field.

Order matters: a feature can only use the Variables above it. One that uses a Variable below it fails and says #name is used before it is defined; move its Variable above this feature. Drag the Variable up the feature list to fix it.

A variable can also switch a feature off. Right-click the feature and choose Dynamic suppression › Suppress by variable…: the feature is suppressed while the variable is 0, or with Suppress when true (not 0) while it isn’t.