export#

ScalarComplex.export(output_file: str | None, name: str | None = None, **kwargs) str | bool#

Register and export this expression to a field file.

Extra keyword arguments are forwarded to FieldsCalculator.export`(``solution`(), sample_points, grid_type, intrinsics …). is_vector is set automatically.

Parameters:
output_filestr, optional

Full path and name to save the file to. The default is None, in which case the file is exported to the working directory.

namestr, optional

Solution name, for example "Setup1 : LastAdaptive".

Returns:
bool or str

The path to the exported field file when successful, False when failed.

Examples

Export a field quantity through the bound calculator.

>>> calc = type(
...     "Calc",
...     (),
...     {
...         "design_type": "HFSS",
...         "add_expression": staticmethod(lambda *args, **kwargs: kwargs["name"]),
...         "export": staticmethod(lambda **kwargs: kwargs["output_file"]),
...     },
... )()
>>> from ansys.aedt.core.visualization.post.field_calculator_expressions import FieldExpressions
>>> fx = FieldExpressions(calc)
>>> fx.vector("E").export("out.fld", name="vec_e")
'out.fld'