Setting model layout using parameter table or Flexscript

Setting model layout using parameter table or Flexscript

christopher_c5
Not applicable
586 Views
5 Replies
Message 1 of 6

Setting model layout using parameter table or Flexscript

christopher_c5
Not applicable

[ FlexSim 21.1.4 ]

I have a model with three different layouts and three different backgrounds. I would like to switch between the layouts and the backgrounds using the parameters table. I have working code that allows me to hide or display the background based on a model parameter. I have not been able to find a reference on how to set a model layout based on the parameter table or how to set it via Flexscript. I'd appreciate any help you can provide.

0 Likes
Accepted solutions (1)
587 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor

you will probably build three models on three different visual planes. Then you can set the one currently visible you want to show.

0 Likes
Message 3 of 6

christopher_c5
Not applicable
Additionally, is there a way to find which model layout is currently selected in Flexscript? That will also work for me.
0 Likes
Message 4 of 6

christopher_c5
Not applicable
Unfortunately this model is very complicated and will require a lot of work to do that. I'm just trying to avoid having to set parameters in multiple places to make it function correctly.
0 Likes
Message 5 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

Choose the Set Model Layout option in the On Set of a parameter.

1624638672821.png

If you look at the code for that option you'll see that the FlexScript function it's calling is

applicationcommand("changemodellayout", layout.name);


Matthew Gillespie
FlexSim Software Developer

Message 6 of 6

christopher_c5
Not applicable

Thanks! I didn't think to look under "On Set" without a reference set. Just so its clear to others, this is all the code you need:

applicationcommand("changemodellayout", "layout name")
0 Likes