question

sachin tandulkar avatar image
1 Like"
sachin tandulkar asked Phil BoBo edited

Can we toggle on and off the background in FlexSim?

Can we toggle on and off the background in FlexSim?

Choose One
backgroundtoggle background
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

Sam Stubbs avatar image
2 Likes"
Sam Stubbs answered Phil BoBo edited

So you can hide or show objects using the command: switch_hideshape().

switch_hideshape(BackgroundNode,1) (this would hide the object)

switch_hideshape(BackgroundNode,0) (this shows the object.)

Replace BackgroundNode with a reference to your own background object. You can find the node from your model tree.

You could also add this hide/show logic to buttons on a Dashboard to make it more accessible.

I've attached a simple model demonstrating this.

hidebutton.fsm


hidebutton.fsm (12.5 KiB)
· 3
5 |100000

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

sachin tandulkar avatar image sachin tandulkar commented ·

Thanks Sam. That is what I needed. I changed it from button to a Checkbox, so now I can check and uncheck to make it on and off.

1 Like 1 ·
Osman Eralp avatar image Osman Eralp commented ·

I had the same question a few weeks ago. I think there should be a check box in the View settings for background on or off in the View Settings. The solution you offer is a workaround and not a solution for the problem of not being able to turn the background on and off.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Osman Eralp commented ·

You can hide a background the same way you can hide any object in the model, using the Show 3D Shape checkbox in the object's Properties window.

You can also use the Groups and Edit Selected Objects modeling utilities windows to hide/show the 3D shapes of one or more objects in your model, including the ModelBackground object:

Sam explained how you could more quickly hide it or show it if you didn't want to go to the Background's Properties window to adjust it.

You could use his solution to hide/show any other object or group of objects as well, not just the model background.

Using the software's commands to customize your model and workflow isn't a workaround; it is a feature. FlexSim is flexible and customizable by design.

2 Likes 2 ·