question

Sebastián Cañas avatar image
0 Likes"
Sebastián Cañas asked Sebastián Cañas commented

Click "Apply" in Storage System by Code

Hi all,

I'm drawing some elements on a Rack based on the value of a Parameter. I need to change this value during the run of a simulation, instead of pressing reset every time.

I've realized I could get this by clicking the Apply button in the Storage System. How could I get to do that by code?

Thanks!

Apply_SS.fsm

FlexSim 24.1.0
flexscriptstorage system
apply-ss.fsm (170.7 KiB)
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 Sebastián Cañas commented

I can't see a way of doing the same action without using a function_s call, which - as you probably know - isn't recommended due to it being outside of the supported API. You could use your own draw code but for a large system that probably won't draw as fast.

The function_s call that seems to work for your case is:

function_s(Model.find("Tools/StorageSystem>variables/visualizations/Rack/elements/Image1"),"setAllObjectsDirty");
· 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.

Sebastián Cañas avatar image Sebastián Cañas commented ·
Thanks @Jason. I'm aware of the drawbacks of using function_s. I'll implement this as a temporary workaround.


With more time, I'll give drawing commands like drawquad() or others a shot to test the performance of the model..

0 Likes 0 ·