question

Tamilselvan avatar image
0 Likes"
Tamilselvan asked Arun Kr commented

Replacing the Multiple machines at once

I was trying to replace 100's of processors in the place of combiner at the same time and it should not change only the visual it should include the properties too, without changing the name of the object. is it possible ?


Thanks in Advance

FlexSim 23.1.1
machine replacing
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Arun Kr avatar image
1 Like"
Arun Kr answered Arun Kr commented

This is very much possible in FlexSim. First, add the combiners to a group. Then using a process flow or through a script in the script console record the location and name of the combiners in a global table. Then using another pf or script you can look at the recorded data and create machines with the same name and location.

Here's a sample model. The processor and combiner copies are made from the template machines in the model ("Combiner1 and Processor1).

sample Model.fsm


sample-model.fsm (37.7 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Tamilselvan avatar image Tamilselvan commented ·
Yeah its working but its not copying the exact name of the Combiner.
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Tamilselvan commented ·

@Tamilselvan , can it be that objects you are going to destroy are still present when you insert and copy data to new machines? It is so, that it is not allowed to have two objects with identical names in a model. If you rename an object and it exists by name twice you get a message to be absolutely sure about it.

0 Likes 0 ·
Arun Kr avatar image Arun Kr Tamilselvan commented ·

Attached is the modified model adding combiner names also in a column.

sample-model_1.fsm

0 Likes 0 ·
sample-model-1.fsm (37.9 KiB)
Arun Kr avatar image Arun Kr Tamilselvan commented ·

Another solution is based on SQL Queries.

Table Q = Table.query("SELECT Object,Object.name,Location FROM Objects() WHERE Class = 'Combiner' "); //Selects the combiners from the model

Q.cloneTo(Table("GlobalTable1"));// Clone to a Global table name, location

Table GT = Table("GlobalTable1");
GT.addCol(); // adding an extra colum to GT for Processor Class
int ColNo = GT.numCols;

for(int k=1;k<=GT.numRows;k++)
{
GT[k][ColNo] = "Processor";
}

GT.setColHeader(ColNo,"Class");

Table Q1 = Table.query("DELETE FROM Objects() WHERE Class = 'Combiner' ");// Delete The Combiners

Table Q2 = Table.query("INSERT INTO Objects()(Class,Name, Location) SELECT Class,name,Location FROM GlobalTable1"); //Placing ProcessorsIn the location of Combiners

You can run this script on the script console.

Combiner_Support.fsm

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.