vcUnitGroup
vcUnitGroup represents a group of units that apply to the same quantity and belong to the same unit family, thereby allowing you to create and delete vcUnit objects.
Properties
Name | Type | Access | Description |
IsBuiltIn | Boolean | R | Indicates if unit group is a built-in group. |
Name | String | RW/R | If unit group is built-in, gets the unit group's name; otherwise defines the name of unit group which cannot contain any dot (.) characters. |
Quantity | vcScalarQuantity | R | Gets the quantity referencing unit group. |
Units | List of vcUnit | R | Gets a list of all units in unit group. |
Methods
Name | Return Type | Parameters | Description |
createUnit | Integer | String name, String suffix | If not a built-in unit group, adds a new unit of a given name and suffix to unit group, and then returns the index of new unit in unit group.
If built-in unit group, throws an exception. |
deleteUnitAt | None | Integer index | If not a built-in unit group, removes a unit at a given index in unit group.
If built-in unit group, throws an exception. |
getUnitWithMagnitude | vcUnit | Real magnitude | Returns a unit in unit group that best matches a given magnitude. |