Hello all!
I wanna copy all occurrences of objects from EPC to FAD, which TypeNum of icon is 39 (ST_SCRN) and which have a relationships with functions.
But my script has an error.
Tell me please how can I fix this error. May be I have to other function instead "createCopy"?
This is my code:
function f1(){
for(var i = 0; i < aModels.length; i++){
var oModel = aModels[i];
var aFuncObj = oModel.ObjOccListFilter(Constants.OT_FUNC);
for (var j = 0; j < aFuncObj.length; j++) {
if(aFuncObj[j].SymbolNum() == 335){ // Take only functions which SymbolNum == 335 (ST_FUNC)
var transListFunc = new Array;
var transListFunc = aFuncObj[j].getConnectedObjOccs ( [ Constants.ST_SCRN], Constants.EDGES_INOUT );
if (transListFunc.length!=0){
var gr = GetOrCreateGroup(oModel, "Транзакции"); // Create group "Transactions"
var fadModel = GetOrCreateModel(gr, aFuncObj[j].ObjDef().Name(1049), Constants.MT_FUNC_ALLOC_DGM); // Create FAD-model which names as function name which have transactions
aFuncObj[j].ObjDef().CreateAssignment(fadModel);
for( var t = 0; t < transListFunc.length; t++ ) { // Iterate all transactions, which have relations aFuncObj[j]
//This I wanna use function, that copy objects to FAT
createCopy ( fadModel, transListFunc[t].OccList() ); // Error: "createCopy" is not defined
}
}
}
}
}
}