The physical unit expressing the physical quantity.
object.PhysUnit(aIndex)
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISCDOPhysQuantity interface |
|
aIndex |
In, Required | int |
The index of the physical unit |
Display some information about the specified physical quantity, including its system physical unit, the number of other physical units, their names and values converted into the source physical unit.
Dim aSrcUnit, aUnit
Dim aPhysQuantity
Dim aValue
Dim i
Dim aMessage
Set aSrcUnit = Profile.FindCDOPsysUnitByText("g")
set aPhysQuantity = aSrcUnit.PhysQuantity
aMessage = "Source Physical Unit: " & aSrcUnit.AsString & vbNewLIne &_
"Physical Quantity System Unit: " & aPhysQuantity.SysUnit.AsString & vbNewLIne &_
"Other Units of the Physical Quantity: "
for i = 0 to aPhysQuantity.PhysUnitCount - 1
set aUnit = aPhysQuantity.PhysUnit(i)
aValue = aSrcUnit.ConvertValue(1, aUnit)
aMessage = aMessage & vbNewLine & (i + 1) & ") " & aUnit.AsString &_
" (= " & aValue & " " & aSrcUnit.AsString & ")"
next
Profile.MsgBox(aMessage)