Working with Variables

A variable is a numerical value, mathematical expression, or mathematical function that can be assigned to a design parameter in HFSS. You can assign a variable to any dimension, material property, or output value. Variables are useful in the following situations:

Variables can be regular variables, array index variables, or arrays. A project variable’s value can reference other project variables or intrinsics. Values can be a number, variable, or mathematical expression.

There are two types of variables in HFSS:


Project Variables

A project variable can be assigned to any parameter value in the HFSS project in which it was created. HFSS differentiates project variables from other types of variables by prefixing the variable name with dollar sign symbol ($). You can manually include the $ in the project variable's name, or HFSS will automatically append the project variable's name after you define the variable. Project variables can be designated as Design, ArrayIndex or Separator variables but not as Post-Processing Variables.

Design (Local) Variables

A design variable can be assigned to any parameter value in the HFSS design in which it was created. From the Design Variables Properties dialog box, you can Add, Add Array, Edit, or Remove design variables. Design Variables can be designated as Design, ArrayIndex or Separator variables and as Post-Processing Variables.

Clicking View > Variables brings up a dockable variable window that is associated with the active project and/or design. When there is an active project, there will be a corresponding project variable tab. When there is an active design, there will be a corresponding design variable tab. Each tab contains an Add... button allowing creation of new variable of this type. If variables exist for the Project or Design, they are shown in the corresponding tab.

Project Variables Window

Importing and Exporting Variables

Once you have defined Design and/or Project Variables, you can export them to a csv file, and import them to another project or design. If there are naming conflicts on import, these are flagged as errors. The Properties dialogs for Design Variables and Project variables include Import... and Export... buttons.