AssignStructure(Dimension: IDimensionModel);
Dimension. Dictionary, which parameters are necessary to set for a current dictionary.
The AssignStructure method sets a structure of the MDM dictionary in accordance with a structure passed by the Dimension parameter.
Executing the example requires an MDM repository with the OBJ_RSD identifier and a dictionary with the Dimen_1 identifier.
Add links to the Metabase, Rds and Dimensions system assemblies.
Sub UserProc;
Var
MB: IMetabase;
NSI: IMetabaseObjectDescriptor;
CrInfo: IMetabaseObjectCreateInfo;
Dict: IRdsDictionary;
Begin
MB := MetabaseClass.Active;
NSI := MB.ItemById("OBJ_RDS");
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_RDS_DICTIONARY;
CrInfo.Id := MB.GenerateId("NewDictionary");
CrInfo.Name := "New dictionary";
CrInfo.Parent := NSI;
Dict := MB.CreateObject(CrInfo).Edit As IRdsDictionary;
Dict.AssignStructure(MB.ItemById("Dimen_1").Bind As IDimensionModel);
(Dict As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a new MDM dictionary is created in the MDM repository. A structure of a new dictionary is set in accordance with a structure of the Dimen_1 dictionary.
See also: