question

Alireza Hashemloo avatar image
1 Like"
Alireza Hashemloo asked Jacob Gillespie commented

How to assign a large number of locations to a target area in the model all at once?

Hello,

Using Flexsim Healthcare, I need to assign all locations in a given area to a different area in the model. I am aware of the "Copy from Highlighted" menu allowing for copying a particular variable such as the area name from a highlighted object to a group of selected objects. However, it is not easy to find and select a large number of locations (unless they are grouped) in the model to use the "Copy from Highlighted" menu.

I was wondering if there is a script that can find all locations that are under a given area name and assigned them to another existing area in the model.

Please let me know if further description is required.Thank you,

Alireza

FlexSim HC 5.1.0
locationarealarge numbersareaname
5 |100000

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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Jacob Gillespie commented

You can run this script:

  1. string curArea = "ComputerTableArea";
  2. string newArea = "BedArea";
  3.  
  4. for(int i = 1; i <= content(model()); i++)
  5. {
  6. treenode obj = rank(model(), i);
  7. if(getvarstr(obj, "AreaName") == curArea)
  8. {
  9. applicationcommand("createGlobalAreaPointer", obj, curArea, newArea);
  10. UpdateReferences(curArea, newArea);
  11. TransferSingleAreaConnections(obj, newArea);
  12. }
  13. }
· 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.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Alireza Hashemloo commented

You can adapt the method of Tom David to suit your quest. Once you have selected the objects under the area, maybe in a script console, you place them as a group and use the group as you like.

· 1
5 |100000

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