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:

Array types = ["Locations", "Staff", "Transports", "Equipment"];
treenode tools = Model.find("Tools");
for (int i = 1; i <= types.length; i++) {
    string type = types[i];
    treenode group = tools.find("Groups/" + type);
    if (group) group.destroy();
    treenode list = tools.find("GlobalLists/" + type);
    if (list) list.destroy();
}
Array otherNodes = ["People", "PeopleSettings", "PeopleTables", "ModuleDependencies/People", "ColorPalettes/ClothesPalette", "ColorPalettes/HairPalette", "DownBehaviors/OffSchedule", "DownBehaviors/Lunch", "DownBehaviors/Break1", "DownBehaviors/Break2", 
"Toolbox/Lists/People", "Toolbox/Groups/People", "Toolbox/DownBehavior/People", "Toolbox/ColorPalettes/People", "Toolbox/PeopleTables"];
for (int i = 1; i <= otherNodes.length; i++) {
    tools.find(otherNodes[i])?.destroy();
}
Array peopleObjs = [];
forobjecttreeunder(model()) {
    string class = getname(first(classes(a)));
    if (class.startsWith("People::")) peopleObjs.push(a);
}
for (int i = 1; i <= peopleObjs.length; i++)
    peopleObjs[i].destroy();
treenode flows = tools.find("ProcessFlow");
if (flows) {
    for (int i = flows.subnodes.length; i > 0; i--) {
        treenode flow = flows.subnodes[i];
        if (getvarnum(flow, "type") == 4 || getvarnum(flow, "PeopleArrivalsFlow") == 1)
            flow.destroy();
    }
}
· 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 ·

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.