Skip to content

DesignVariableBuilder

Set project-level design variables in an HFSS simulation model.

This builder applies design parameters to the active project before analysis, enabling full parametric sweeps.

Bases: BaseBuilder

Builder for setting design variables in an HFSS model.

This builder sets project-level design parameters before simulation. It’s useful for parametrizing a model and enabling sweeps.

Attributes:

Name Type Description
type Literal['design_variable_builder']

Identifier for this builder type.

design_name str

Name of the HFSS design to activate.

build

build(hfss: Hfss, parameters: dict = None) -> dict

Apply design variables to the HFSS project.

Parameters:

Name Type Description Default
hfss Hfss

Active HFSS session.

required
parameters dict

Dictionary of design variables and their values.

None

Returns:

Name Type Description
dict dict

The same dictionary, confirming the values set in the design.

Source code in src/quansys/workflow/builder/design_variable_builder.py
def build(self, hfss: Hfss,
          parameters: dict = None) -> dict:

    """
    Apply design variables to the HFSS project.

    Args:
        hfss: Active HFSS session.
        parameters: Dictionary of design variables and their values.

    Returns:
        dict: The same dictionary, confirming the values set in the design.
    """

    if parameters is None:
        return {}

    hfss.set_active_design(self.design_name)
    set_variables(hfss, parameters)
    return parameters