Constants#

This section lists constants that are commonly used in PyAEDT.

Example of constants usage:

from ansys.aedt.core import constants
ipk = Icepak()
# Use of Axis constant
cylinder = ipk.modeler.create_cylinder(constants.Axis.X, [0,0,0],10,3)
# Use of PLANE Constant
ipk.modeler.split(cylinder, constants.Plane.YZ, sides="Both")
...
ipk.release_desktop()
class ansys.aedt.core.generic.constants.AllowedMarkers(value)#

An enumeration.

class ansys.aedt.core.generic.constants.Axis(value)#

Coordinate system axis enum class.

This static class defines integer constants corresponding to the Cartesian axes: X, Y, and Z. Attributes can be assigned to the orientation keyword argument for geometry creation methods of the ansys.aedt.core.modeler.modeler_3d.Modeler3D and ansys.aedt.core.modeler.modeler_2d.Modeler2D classes.

Attributes:
Xint

Axis index corresponding to the X axis (typically 0).

Yint

Axis index corresponding to the Y axis (typically 1).

Zint

Axis index corresponding to the Z axis (typically 2).

Examples

>>> from ansys.aedt.core.generic import constants
>>> from ansys.aedt.core import Hfss
>>> hfss = Hfss()
>>> cylinder1 = hfss.modeler.create_cylinder(
...     orientation=constants.Axis.Z,
...     origin=[0, 0, 0],
...     radius="0.5mm",
...     height="3cm",
... )
class ansys.aedt.core.generic.constants.BasisOrder(value)#

HFSS basis order settings enum class.

Warning: the value single has been renamed to Single for consistency. Please update references to single.

class ansys.aedt.core.generic.constants.CATEGORIESQ3D#

Deprecated: Use PlotCategoriesQ3D or PlotCategoriesQ2D instead.

class ansys.aedt.core.generic.constants.CSMode(value)#

Coordinate system mode enum class.

class ansys.aedt.core.generic.constants.CrossSection(value)#

Cross section enum class.

class ansys.aedt.core.generic.constants.CutoutSubdesignType(value)#

Cutout subdesign type enum class.

class ansys.aedt.core.generic.constants.EnumUnits(value)#

An enumeration.

class ansys.aedt.core.generic.constants.Fillet(value)#

Fillet enum class.

class ansys.aedt.core.generic.constants.FlipChipOrientation(value)#

Flip chip orientation enum class.

class ansys.aedt.core.generic.constants.GlobalCS(value)#

Global coordinate system enum class.

class ansys.aedt.core.generic.constants.Gravity(value)#

Gravity direction enum class.

This static class defines integer constants corresponding to the positive direction of gravity force.

Attributes:
XNegint

Positive gravity force is in the -X direction.

YNegint

Positive gravity force is in the -Y direction.

ZNegint

Positive gravity force is in the -Z direction.

XPosint

Positive gravity force is in the +X direction.

YPosint

Positive gravity force is in the +Y direction.

ZPosint

Positive gravity force is in the +Z direction.

class ansys.aedt.core.generic.constants.InfiniteSphereType(value)#

Infinite sphere type enum class.

class ansys.aedt.core.generic.constants.LineStyle(value)#

Line style enum class.

class ansys.aedt.core.generic.constants.MatrixOperationsQ2D(value)#

Matrix operations for Q2D.

class ansys.aedt.core.generic.constants.MatrixOperationsQ3D(value)#

Matrix operations for Q3D.

class ansys.aedt.core.generic.constants.NodeType(value)#

Enum class on the type of node for source creation.

class ansys.aedt.core.generic.constants.Plane(value)#

Coordinate system plane enum class.

This static class defines integer constants corresponding to the Y-Z, Z-X, and X-Y planes of the current coordinate system.

Attributes:
YZint

Y-Z plane (typically 0).

ZXint

Z-X plane (typically 1).

XYint

X-Y plane (typically 2).

class ansys.aedt.core.generic.constants.PlotCategoriesQ2D(value)#

Plot categories for Q2D.

class ansys.aedt.core.generic.constants.PlotCategoriesQ3D(value)#

Plot categories for Q3D.

class ansys.aedt.core.generic.constants.RadiationBoxType(value)#

Radiation box type enum class.

class ansys.aedt.core.generic.constants.SOLUTIONS#

Deprecated.

class ansys.aedt.core.generic.constants.SegmentType(value)#

Segment type enum class.

class ansys.aedt.core.generic.constants.Setups(value)#

Setup types enum class.

class ansys.aedt.core.generic.constants.SolutionsCircuit(value)#

Circuit solution types enum class.

class ansys.aedt.core.generic.constants.SolutionsHfss(value)#

HFSS solution types enum class.

class ansys.aedt.core.generic.constants.SolutionsIcepak(value)#

Icepak solution types enum class.

class ansys.aedt.core.generic.constants.SolutionsMaxwell2D(value)#

Maxwell 2D solution types enum class.

class ansys.aedt.core.generic.constants.SolutionsMaxwell3D(value)#

Maxwell 3D solution types enum class.

class ansys.aedt.core.generic.constants.SolutionsMechanical(value)#

Mechanical solution types enum class.

class ansys.aedt.core.generic.constants.SolverType(value)#

Provides solver type classes.

class ansys.aedt.core.generic.constants.SourceType(value)#

Type of excitation enum class.

class ansys.aedt.core.generic.constants.SweepDraft(value)#

Sweep draft type enum class.

class ansys.aedt.core.generic.constants.SweepType(value)#

Sweep type enum class.

class ansys.aedt.core.generic.constants.SymbolStyle(value)#

Symbol style enum class.

class ansys.aedt.core.generic.constants.TraceType(value)#

Trace type enum class.

class ansys.aedt.core.generic.constants.View(value)#

View enum class.

This static class defines integer constants corresponding to the X-Y, Y-Z, and Z-X planes of the current coordinate system, and ISO for isometric view.

Attributes:
XYint

Set the view along the Z-Axis (view of the XY plane).

YZint

Set the view along the X-Axis (view of the YZ plane).

ZXint

Set the view along the Y-Axis (view of the ZX plane).

ISOint

Isometric view from the (x=1, y=1, z=1) direction.

ansys.aedt.core.generic.constants.cel2kel(val, inverse=True)#

Convert a temperature from Celsius to Kelvin.

Parameters:
valfloat

Temperature value in Celsius.

inversebool, optional

The default is True.

Returns:
float

Temperature value converted to Kelvin.

ansys.aedt.core.generic.constants.db10(x, inverse=True)#

Convert db10 to decimal and vice versa.

ansys.aedt.core.generic.constants.db20(x, inverse=True)#

Convert db20 to decimal and vice versa.

ansys.aedt.core.generic.constants.dbm(x, inverse=True)#

Convert W to decimal and vice versa.

ansys.aedt.core.generic.constants.dbw(x, inverse=True)#

Convert W to decimal and vice versa.

ansys.aedt.core.generic.constants.deprecate_enum(new_enum)#

Decorator to mark an enumeration class as deprecated.

It allows you to keep the old enumeration class in the code and redirect its attributes to a new enumeration class.

ansys.aedt.core.generic.constants.fah2kel(val, inverse=True)#

Convert a temperature from Fahrenheit to Kelvin.

Parameters:
valfloat

Temperature value in Fahrenheit.

inversebool, optional

The default is True.

Returns:
float

Temperature value converted to Kelvin.

ansys.aedt.core.generic.constants.scale_units(scale_to_unit)#

Find the scale_to_unit into main system unit.

Parameters:
scale_to_unitstr

Unit to Scale.

Returns:
float

Return the scaling factor if any.

ansys.aedt.core.generic.constants.unit_converter(values, unit_system='Length', input_units='meter', output_units='mm')#

Convert unit in specified unit system.

Parameters:
valuesfloat, list

Values to convert.

unit_systemstr

Unit system. Default is “Length”.

input_unitsstr

Input units. Default is “meter”.

output_unitsstr

Output units. Default is “mm”.

Returns:
float, list

Converted value.

ansys.aedt.core.generic.constants.unit_system(units)#

Retrieve the name of the unit system associated with a unit string.

Parameters:
unitsstr

Units for retrieving the associated unit system name.

Returns:
str

Key from the AEDT_units when successful. For example, "AngularSpeed".

False when the units specified are not defined in AEDT units.
ansys.aedt.core.generic.constants.validate_enum_class_value(cls, value)#

Check whether the value for the class enumeration-class is valid.

Parameters:
clsclass

Enumeration-style class with integer members in range(0, N) where cls.Invalid equals N-1.

valueint

Value to check.

Returns:
bool

True when the value is valid for the enumeration-class, False otherwise.