I use the code to create racks in script console,and it works.
But when I use the same code in User command,it doesn't work.
I don't know why.
/**Custom Code*/ int number = 60;// 列数 int numBays = number/3; int numLevels = 12;// 层数 double bayWidth = 0.54; // 单列宽 double levelHeight = 0.5;// 单层高 treenode libraryRack = library().find("?Rack"); Object firstRack = createinstance(libraryRack, model());//创建货架 function_s(libraryRack, "BasicRefreshTable", firstRack, numLevels, numBays, levelHeight, bayWidth);//创建规定尺寸的货架 for(int i = 2; i <=3 ; i++) { Object obj = createcopy(firstRack, model(), 1, 0, 1, 0); // 复制货架 obj.name = "Rack1" + numtostring(i); obj.location.x = 1*(i-1)+(i-1)*numBays*bayWidth; obj.location.y = 0; }