Assign: Boolean;
The Assign property determines whether an object copy along with its data source is created.
The property is set to False by default, in this case copying is executed based on the object description specified in the Source property. If the property is set to True, in the Source property specify the copied object, in this case an object copy and copy of its data source along with data are created.
Executing the example requires a modeling container with the CONT_MODEL identifier. This container contains a modeling variable with the Var_1 identifier.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Cont: IMetabaseObjectDescriptor;
CInfo: IMetabaseObjectCopyInfo;
Begin
MB := MetabaseClass.Active;
Cont := MB.ItemById("CONT_MODEL");
CInfo := MB.CreateCopyInfo;
CInfo.Id := "Copy_Var_1";
CInfo.Name := "Copy of the Var_1 variable";
CInfo.Destination := Cont;
CInfo.Source := MB.ItemByIdNamespace("VAR_1", Cont.Key).Bind;
CInfo.Assign := True;
MB.CopyObject(CInfo);
End Sub UserProc;
After executing the example a copy of the variable is created in the modeling container. Also, on copying a copy of automatic cube, on which the variable is based, is created.
See also: