
// 引入模块 包
var $ = require('topcam.scriptfunc').argv();
var fs = require('fs');
var _ = require('lodash');
var IKM = $.ikm;
var GEN = $.gen;
var GUI = $.gui;
var Job = $.job;
var JobId = $.job_id;

try {

    var _matrix = GEN.getMatrix({job:job})
    var _layers = Object.keys(_matrix)
    var specialLayers = _layers.filter(function(v){return /^gnd\d?\\.art$|^in\d?\\.art$|^vcc\\.art$/.test(v)})
    var _tmpdata = tmp(specialLayers)
    _tmpdata.forEach(function(item,v){
        GEN.renameLayer({job:job,layer:item.layer,new_name:'gnd' + (v+2) + ".art"})
    })

    return "Done"
} catch (e) {
	return "Error"
}
