IRubricator.Units

Syntax

Units: IRdsDictionary;

Description

The Units property determines the MDM repository dictionary that contains information about measurement units.

Example

Executing the example requires a time series database with the NewCatalog identifier. The measures dictionary contains an element named Meter.

Sub Main;

Var

MB: IMetabase;

Rubr: IRubricator;

Units: IRdsDictionary;

UnitsInst: IRdsDictionaryInstance;

Att: IRdsAttributes;

Elem: IRdsDictionaryElements;

Link: IRDsLinkInstance;

Data: IRdsDictionaryElementData;

LookupElem: IRdsDictionaryElementsLookup;

Begin

Mb := MetabaseClass.Active;

Rubr := MB.ItemById("NewCatalog").Bind As IRubricator;

Units := Rubr.Units;

UnitsInst := Units.Open(Null);

Link := UnitsInst.Links.Item(0);

Att := Units.Attributes;

Elem := UnitsInst.Elements;

Data := Elem.CreateElementData;

Data.Attribute(Att.Name.Key) := Length;

LookupElem := Link.ReferenceDictionary.CreateLookup("NAME");

LookupElem.Data.Value(0) := Metre;

Data.Attribute(Att.FindById("MEASURE").Key) := LookupElem.Lookup.Item(0);

Data.Attribute(Att.FindById("SCALE").Key) := 100;

Elem.Insert(Elem.Item(0).Key, Data);

End Sub Main;

After executing the example a new element is added to the dictionary that contains information on the measurement units used in the time series database. This element is linked with the Meter measurement unit contained in the measures dictionary.

See also:

IRubricator