question

Stan Davis avatar image
1 Like"
Stan Davis asked Stan Davis commented

How Do I Remove People Module Components?

For some reason my model now has People module 'items' in it..

1637269579732.png


I am not using any people module items. I believe they came in when I created a visual shape and pointed it to modules\People\shapes\locations\metalchair.3ds.

FlexSim is not letting me remove any of these items since they are protected. How do I remove them? They are not needed. Thanks - Stan

FlexSim 21.2.4
people module
1637269579732.png (7.7 KiB)
· 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.

Stan Davis avatar image Stan Davis commented ·
I removed them by deleting their nodes in the tree. For some I had to unprotect them first. My concern is there are some remnants in the bowels of the model that may cause problems later. Is there a better way?
0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Stan Davis commented

If you add any of the objects from the People section of the library (3D or Process Flow) then a bunch of other People objects will be added to your model to facilitate building a People model.

Here's a script you could run to remove any People objects in your model:

  1. Array types = ["Locations", "Staff", "Transports", "Equipment"];
  2. treenode tools = Model.find("Tools");
  3. for (int i = 1; i <= types.length; i++) {
  4.     string type = types[i];
  5.     treenode group = tools.find("Groups/" + type);
  6.     if (group) group.destroy();
  7.     treenode list = tools.find("GlobalLists/" + type);
  8.     if (list) list.destroy();
  9. }
  10. Array otherNodes = ["People", "PeopleSettings", "PeopleTables", "ModuleDependencies/People", "ColorPalettes/ClothesPalette", "ColorPalettes/HairPalette", "DownBehaviors/OffSchedule", "DownBehaviors/Lunch", "DownBehaviors/Break1", "DownBehaviors/Break2", 
  11. "Toolbox/Lists/People", "Toolbox/Groups/People", "Toolbox/DownBehavior/People", "Toolbox/ColorPalettes/People", "Toolbox/PeopleTables"];
  12. for (int i = 1; i <= otherNodes.length; i++) {
  13.     tools.find(otherNodes[i])?.destroy();
  14. }
  15. Array peopleObjs = [];
  16. forobjecttreeunder(model()) {
  17.     string class = getname(first(classes(a)));
  18.     if (class.startsWith("People::")) peopleObjs.push(a);
  19. }
  20. for (int i = 1; i <= peopleObjs.length; i++)
  21.     peopleObjs[i].destroy();
  22. treenode flows = tools.find("ProcessFlow");
  23. if (flows) {
  24.     for (int i = flows.subnodes.length; i > 0; i--) {
  25.         treenode flow = flows.subnodes[i];
  26.         if (getvarnum(flow, "type") == 4 || getvarnum(flow, "PeopleArrivalsFlow") == 1)
  27.             flow.destroy();
  28.     }
  29. }
· 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.

Stan Davis avatar image Stan Davis commented ·
Understood and thank you! - Stan
0 Likes 0 ·