Assign: Boolean;
The Assign property determines whether an object copy along with its data source is created.
Default property value is False, in this case copying is performed on the base of object description specified in the Source property. If property value is True, in the Source property it is necessary to specify a copied object itself, 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 KONT_MODEL identifier. This container includes a modeling variable with the Var_1 identifier.
Sub Main;
Var
MB: IMetabase;
Kont: IMetabaseObjectDescriptor;
CInfo: IMetabaseObjectCopyInfo;
Begin
MB := MetabaseClass.Active;
Kont := MB.ItemById("KONT_MODEL");
CInfo := MB.CreateCopyInfo;
CInfo.Id := "Copy_Var_1";
CInfo.Name := "Copy of variable Var_1";
CInfo.Destination := Kont;
CInfo.Source := MB.ItemByIdNamespace("VAR_1", Kont.Key).Bind;
CInfo.Assign := True;
MB.CopyObject(CInfo);
End Sub Main;
After executing this example a copy of the VAR_1 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: