Quantity#

class ansys.stk.core.stkutil.Quantity#

Object that contains a quantity.

Overview#

convert_to_unit

Change the value in this quantity to the specified unit.

add

Add the value from the Quantity interface to this interface. Returns a new Quantity. The dimensions must be similar.

subtract

Subtracts the value from the Quantity interface to this interface. Returns a new Quantity. The dimensions must be similar.

multiply_qty

Multiplies the value from the Quantity interface to this interface. Returns a new Quantity. The dimensions must be similar.

divide_qty

Divides the value from the Quantity interface to this interface. The dimensions must be similar.

dimension

Get the name of the dimension.

unit

Get the current Unit abbreviation.

value

Get or set the current value.

Import detail#

from ansys.stk.core.stkutil import Quantity

Property detail#

property Quantity.dimension: str#

Get the name of the dimension.

property Quantity.unit: str#

Get the current Unit abbreviation.

property Quantity.value: float#

Get or set the current value.

Method detail#

Quantity.convert_to_unit(self, unit_abbrv: str) None#

Change the value in this quantity to the specified unit.

Parameters:

unit_abbrv : str

Returns:

None

Quantity.add(self, quantity: Quantity) Quantity#

Add the value from the Quantity interface to this interface. Returns a new Quantity. The dimensions must be similar.

Parameters:

quantity : Quantity

Returns:

Quantity

Quantity.subtract(self, quantity: Quantity) Quantity#

Subtracts the value from the Quantity interface to this interface. Returns a new Quantity. The dimensions must be similar.

Parameters:

quantity : Quantity

Returns:

Quantity

Quantity.multiply_qty(self, quantity: Quantity) Quantity#

Multiplies the value from the Quantity interface to this interface. Returns a new Quantity. The dimensions must be similar.

Parameters:

quantity : Quantity

Returns:

Quantity

Quantity.divide_qty(self, quantity: Quantity) Quantity#

Divides the value from the Quantity interface to this interface. The dimensions must be similar.

Parameters:

quantity : Quantity

Returns:

Quantity