UnitsHelper#

class ansys.mechanical.stubs.v261.Ansys.ACT.Mechanical.UnitsHelper#

Bases: object

Defines set of methods that can be used to find mechanical unit information

Overview#

ConvertMechanicalUnitToCoreUnit

Takes input mechanical unit string and category string

GetCurrentCompactUnitString

Return a compact unit string for the supplied field.

GetQuantityNameBasedOnUnitCategoryType

GetQuantityNameBasedOnUnitCategoryType method.

GetValidQuantityNamesAndUnits

Retrieve a dictionary of quantity names to unit strings.

RegisterConvertionFunction

RegisterConvertionFunction method.

Equals

Equals method.

GetHashCode

GetHashCode method.

GetType

GetType method.

ToString

ToString method.

Method detail#

classmethod UnitsHelper.ConvertMechanicalUnitToCoreUnit(mechanicalUnit: str, unitCategory: str) str#
Takes input mechanical unit string and category string
And returns framework unit string which can be used for conversion
UnitsHelper.Equals(obj: Any) bool#

Equals method.

classmethod UnitsHelper.GetCurrentCompactUnitString(quantityName: str) str#
Return a compact unit string for the supplied field.
for example, on an acceleration object acc (in MKS and NMM, respectively):
-  acc.Magnitude.Output.Unit ==> 'm sec^-1 sec^-1' , 'm sec^-1 sec^-1'
-  GetCurrentCompactUnitString(ExtAPI, acc.Magnitude.Output.QuantityName) ==> 'm/s²' , 'mm/s²'
UnitsHelper.GetHashCode() int#

GetHashCode method.

classmethod UnitsHelper.GetQuantityNameBasedOnUnitCategoryType(unitCategory: Ansys.Mechanical.DataModel.Enums.UnitCategoryType) str#

GetQuantityNameBasedOnUnitCategoryType method.

UnitsHelper.GetType() type#

GetType method.

classmethod UnitsHelper.GetValidQuantityNamesAndUnits() dict[str, str]#
Retrieve a dictionary of quantity names to unit strings.
These quantity names represent valid quantity names that can be used when defining quantities in
Mechanical ACT extensions.
classmethod UnitsHelper.RegisterConvertionFunction(fct: System.Func[str, str, str]) None#

RegisterConvertionFunction method.

UnitsHelper.ToString() str#

ToString method.