question

Loubna E avatar image
0 Likes"
Loubna E asked Jason Lightfoot edited

How I can Change the number of slots by level by bay and not by rack ?

FlexSim 22.0.2
slots
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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

In the dimension editor select the level /bay combination you want to change and type the number of slots you need in that location.

· 7
5 |100000

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

Loubna E avatar image Loubna E commented ·

Thank you but if i want to do it a script?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Loubna E commented ·

This may not be supported in future so don't use this throughout your model - better to put it in a user command so if it stops being supported you can change the command to something that is.

Storage.Object rack=current;
int numslots=3;
for (int b=rack.bays.length;b>0;b--){  //bays
    for (int l=rack.bays[b].levels.length;l>0;l--){  //levels
        function_s(rack, "setNumSlots", numslots, [[b,l,1]]);  
    }
}
1 Like 1 ·
Loubna E avatar image Loubna E Jason Lightfoot ♦♦ commented ·

I think this code modify the number of slots for bays with those number [b,l,1]

1653309517844.png


0 Likes 0 ·
1653309517844.png (42.1 KiB)
Loubna E avatar image Loubna E commented ·

I dont know what to do after selecting the level and the bay to change the number of slots 1653307338196.png

0 Likes 0 ·
1653307338196.png (5.8 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Loubna E commented ·

Sorry - there was a typo in my original post - I've updated it.

But you can see the call to set the slots just uses numeric values for the bay and level - so in your case you would use:

Storage.Object rack=Model.find("Rack1");
int bay=2;
int level=1;
int numslots=5;
function_s(rack,"setNumSlots",numslots,[[bay,level,1]]);
0 Likes 0 ·
Loubna E avatar image Loubna E Jason Lightfoot ♦♦ commented ·
Yes it works thank you so much for your help.

And can we change the size of slots, size by slots and not all the slots with same size?

0 Likes 0 ·
Show more comments