Hi All ,
Can anyone please let me know, How to syn or copy a group ,subgroup and model from one group to another group within the database difference via script? I have tried But still I was unable to do. What is the syntax?
what has reference links about it?
please help ,
Thanks in advance.
Hi,
you have to open a database object for the other database. And then you can either use a merge object to merge objects/models/groups from the source to the target database. Or you can create new groups and name them as the group in the source.
Just copying a group from one database to another is never possible - always via merge.
oTargetDB = ArisData.openDatabase(sTargetDBName, sUser, sPassword, g_oSourceDB.ActiveFilter().GUID(), g_nLoc[0])
oMerge = Context.getComponent("Merge");
var arMergeList = new Array();
arMergeList.push(oMasterModel);
var oGroupScriptInfo = oMerge.createGroupScriptInfo([null], false);
var tResult = oMerge.createVariant(arMergeList, oVariantModel.Group(), aoObjDefMapping, oGroupScriptInfo);
if (tResult.isSuccessful()){
// get the newly created variant model
var tResultMapping = tResult.getMapping();
for (i = 0; i < tResultMapping.length; i++){
if (tResultMapping[i].getTargetObject().KindNum() == 10005){
oNewVariantModel = tResultMapping[i].getTargetObject();
break;
}
}
if (oNewVariantModel != null && oNewVariantModel.IsValid()){
asOutput[1] = "Ein neues Variantenmodell wurde angelegt:") + oNewVariantModel.Name(g_nLoc[0]);
}
BR Robert
Hi Robert
How about the script ?
if there are three databases ,that is db x , db y ,and db z,
and in db x, db y, and db z there is group named NANO , in NANO in db x,how syn or copy group 1, group 2, group 3 from db x to db y and db z for every day ?
I have tried But still I was unable to do.
i am newbie
please help
best regards
fajar