question

Omar Aguilera Rico avatar image
1 Like"
Omar Aguilera Rico asked Phil BoBo edited

Update cell size by code, does not visually adjust 3D to new measurements.

I have the following model that adjusts the cell size of the floor storage but visually it does not do it at the time of applying the code. Only if I manually select Floor Storage> Proporties> Storage Object> Edit Dimensions by clicking on an option of this property the measurements are visually updated to the object.

I have a model where I have more than a thousand floor storage and doing this manually one by one at a time will take a lot of time.

How can I cover this part by means of the code?

Update Size Floor Storage.fsm

FlexSim 21.1.4
flexsim 21.1.4floor storagesizecell
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

Typically you try to get the mechanism of the property panel by inspection of the tree and view tree structure. If there is not involved a mechanism on reset, you must probably update view and repaint all. Topic is “ explore structure”.

0 Likes 0 ·

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

Call function_s(rack, "refreshBayLevelSlotLocations");

int CantidadObjetosEnGrupo = content(Model.find("Tools/Groups/Floor Storage"));

for (int r = 1; r <= CantidadObjetosEnGrupo; r++) {
    Object IdentificaFloorStorage = groupmember("Floor Storage",r);

    Storage.Object current = IdentificaFloorStorage;

    for (int i = 1; i <= current.bays.length; i++) {
        Storage.Bay bay = current.bays[i];
        getvarnode(current, "bays").subnodes[i].subnodes[2].value = 4;
        rackgetbaycontent(current,i);
        for (int j = 1; j <= bay.levels.length; j++) {
            Storage.Level level = bay.levels[j];
            getvarnode(current, "bays").subnodes[i].subnodes[4].subnodes[j].subnodes[2].value = 3.13;
        }
    }
    function_s(current, "refreshBayLevelSlotLocations");
}

A better solution would be to use the setProperty() method to set the dimensions rather than adjusting the tree values directly:

int CantidadObjetosEnGrupo = content(Model.find("Tools/Groups/Floor Storage"));

for (int r = 1; r <= CantidadObjetosEnGrupo; r++) {
    Object IdentificaFloorStorage = groupmember("Floor Storage",r);

    Map dimensions = IdentificaFloorStorage.getProperty("Dimensions");
    dimensions["BaySize"] = 2.24;
    dimensions["LevelSize"] = 3.43;
    IdentificaFloorStorage.setProperty("Dimensions", dimensions);
}
5 |100000

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