The scalar_value_conversion.py module#

Summary#

to_boolean_value

Convert the given value to a BooleanValue type.

to_integer_value

Convert the given value to an IntegerValue type.

to_real_value

Convert the given value to a RealValue type.

to_string_value

Convert the given value to a StringValue type.

Description#

Defines scalar value visitors.

Module detail#

scalar_value_conversion.to_boolean_value(other: ansys.tools.variableinterop.variable_value.IVariableValue) ansys.tools.variableinterop.scalar_values.BooleanValue#

Convert the given value to a BooleanValue type.

The conversion is performed according to the type interoperability specifications. Note that some conversions are lossy (resulting in a loss of precision), and some conversions are not possible (raises IncompatibleTypesException).

Parameters:
otherIVariableValue

Other value to convert to a BooleanValue type.

Returns:
BooleanValue

Value as a BooleanValue type.

scalar_value_conversion.to_integer_value(other: ansys.tools.variableinterop.variable_value.IVariableValue) ansys.tools.variableinterop.scalar_values.IntegerValue#

Convert the given value to an IntegerValue type.

The conversion is performed according to the type interoperability specifications. Note that some conversions are lossy (resulting in a loss of precision), and some conversions are not possible (raises IncompatibleTypesException).

Parameters:
otherIVariableValue

Other value to convert to an IntegerValue type.

Returns:
IntegerValue

Value as an IntegerValue type.

scalar_value_conversion.to_real_value(other: ansys.tools.variableinterop.variable_value.IVariableValue) ansys.tools.variableinterop.scalar_values.RealValue#

Convert the given value to a RealValue type.

The conversion is performed according to the type interoperability specifications. Note that some conversions are lossy (resulting in a loss of precision), and some conversions are not possible (raises IncompatibleTypesException).

Parameters:
otherIVariableValue

Other value to convert to a RealValue type.

Returns:
RealValue

Value as a RealValue type.

scalar_value_conversion.to_string_value(other: ansys.tools.variableinterop.variable_value.IVariableValue) ansys.tools.variableinterop.scalar_values.StringValue#

Convert the given value to a StringValue type.

The conversion is performed according to the type interoperability specifications. Note that some conversions are lossy (resulting in a loss of precision), and some conversions are not possible (raises IncompatibleTypesException).

Parameters:
otherIVariableValue

Other value to convert to a StringValue type.

Returns:
StringValue

Value as a StringValue type.