calculator_write#
- FieldsCalculator.calculator_write(expression, output_file, setup=None, intrinsics=None)#
Save the content of the stack register for future reuse in a later Field Calculator session.
- Parameters:
- expression
str
Expression name. The expression must exist already in the named expressions list in AEDT Fields Calculator.
- output_file
str
File path to save the stack entry to. File extension must be either
.fld
or.reg
.- setup
str
Solution name. If not provided the nominal adaptive solution is taken.
- intrinsics
dict
Intrinsics variables provided as a dictionary. Key is the variable name and value is the variable value. These are typically: frequency, time and phase. If it is a dictionary, keys depend on the solution type and can be expressed as: -
"Freq"
. -"Time"
. -"Phase"
. The default isNone
in which case the intrinsics value is automatically computed based on the setup.
- expression
- Returns:
- bool
True
when successful,False
when failed.
Examples
>>> from ansys.aedt.core import Hfss >>> hfss = Hfss() >>> poly = hfss.modeler.create_polyline([[0, 0, 0], [1, 0, 1]], name="Polyline1") >>> expr_name = hfss.post.fields_calculator.add_expression("voltage_line", "Polyline1") >>> file_path = os.path.join(hfss.working_directory, "my_expr.fld") >>> hfss.post.fields_calculator.calculator_write("voltage_line", file_path, hfss.nominal_adaptive) >>> hfss.release_desktop(False, False)