question

Christopher C5 avatar image
0 Likes"
Christopher C5 asked Christopher C5 commented

Setting model layout using parameter table or Flexscript

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.

FlexSim 21.1.4
flexscript
· 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.

Christopher C5 avatar image Christopher C5 commented ·
Additionally, is there a way to find which model layout is currently selected in Flexscript? That will also work for me.
0 Likes 0 ·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Christopher C5 commented

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);

1624638672821.png (26.8 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.

Christopher C5 avatar image Christopher C5 commented ·

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 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Christopher C5 commented

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

· 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.

Christopher C5 avatar image Christopher C5 commented ·
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 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.