question

Preet avatar image
0 Likes"
Preet asked Preet commented

How to assign same load and unload time to all members in a group?

I have a model which has many identical task executors (robots). How would I assign same load time and unload time to all robots with minimum efforts? One trivial way is to go and change these times for each robot manually which is definitely not a preferred way. I have created a global table which has those values.

Thanks!

FlexSim 23.0.0
values for group
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

Kavika F avatar image
1 Like"
Kavika F answered Preet commented

Hey @Preet, here are a few options you could try.

1. Select all of the Robots either with Shift-click or Control-click; this will select them all and highlight them with a red box. Then, you can change the load and unload times on one and it will affect all of the selected robots.

2. You could run a script that looks at every node in your model to see if it's a robot. If it is, then you modify the load and unload times.

treenode root = model();
int loadTime = 10;
int unloadTime = 5;
for (int i = 1; i <= root.subnodes.length; i++) {
  treenode node = root.subnodes[i];
  if (!isclasstype(node, "Robot")) {
    // print("Not a robot");
    continue;
  }
  TaskExecuter robot = node.as(TaskExecuter);
  robot.setVariable("loadtime", loadTime);
  robot.setVariable("unloadtime", unloadTime);
}

If you right-click on a Robot and select "Explore Tree", you can open the properties of the Robot. Check out the "variables" subnode to see what other variables and properties you can adjust.

1674263857387.png


1674263857387.png (10.5 KiB)
· 2
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Three more ways without using code or the tree :

1) You can use the Edit Selected Objects tool having selected them all from the Group and the either copy the variables over or change the value of them all in the Properties window.

2) Open the Properties table and copy the value for all the members of the group.

3) Use a template and have the instances inherit the properties from the template master.


1 Like 1 ·
Preet avatar image Preet commented ·
Hi @Kavika F ! Really appreciate your thorough answer. Both solutions you mentioned as working as expected.


I am new at Flexsim and it is really hard to find answers to specific questions about flexsim. But seeing so much quick response for the question I posted and looking at the response time to other question, I am really impressed.

Once again, thank you very much for your help!

0 Likes 0 ·