question

Jon Abbott avatar image
0 Likes"
Jon Abbott asked Jason Lightfoot commented

How to change the rack visualization type using code?

Hello, I am interested in changing the rack visualization type from "Rack" to "Wireframe" using code instead of the Properties window in the GUI. I see in the model tree that the rack node has a variable called "visualization" that is set to "/Tools/StorageSystem>variables/visualizations/Rack" but I am uncertain how to change this to "Tools/StorageSystem>variables/visualizations/Wireframe". Please let me know if there is a way to do this using code. Thanks in advance for any assistance you can provide.

FlexSim 20.0.9
rackcodestorage systemvisualizationflexsim 20.0.9
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
1 Like"
Jason Lightfoot answered Jason Lightfoot commented
rack.setVariable("visualization",Model.find("/Tools/StorageSystem>variables/visualizations/Wireframe"));
· 2
5 |100000

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

Jon Abbott avatar image Jon Abbott commented ·

Thanks @jason.lightfoot. I had to use as(Object) to get this to work, but it works nicely. Here is the example code including as(Object), in case it helps anyone else:

Model.find("Rack1").as(Object).setVariable("visualization",Model.find("/Tools/StorageSystem>variables/visualizations/Wireframe"));
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Jon Abbott commented ·

Hehe, sorry, I assumed that if you were changing the rack properties in code you’d already have a pointer to it.

1 Like 1 ·

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.