question

Enrique Elizaga avatar image
0 Likes"
Enrique Elizaga asked tannerp commented

Is it possible to save multiple workspaces not just the "default worskpace"?

Hi,

I'm preparing a model where the layout is really important because of so many things (views) going on at the same time with tables, 3d, process flow and dashboards. It would be really valuable for me to go back and forth from one layout to some other 3 workspaces during execution. Is there a way to do this?

FlexSim 20.1.1
flexsim 20.1.1workspace
5 |100000

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

tannerp avatar image
0 Likes"
tannerp answered tannerp commented

@Enrique Elizaga,

There is a way to do this, although I'm not sure I recommend it. Here's what I did:

1) Use the following code to save the current workspace as a new treenode. Note that you cannot save workspaces with dashboards open. Everything else will work.

// update the environment node for prefs.t
//Check to see if there are any dashboards open
treenode dashboards = node("VIEW:/active>Documents/Dashboard");
if (content(dashboards) > 0) {
    msg("Workspace Error", "Dashoards cannot be open when saving the workspace as default.\nPlease close all dashboards before setting the current workspace as default.", 1);
    return 0;
}

treenode defaultWorkspace = assertsubnode(assertsubnode(node("VIEW:/environment"), "Workspaces"), "Default");

treenode test = defaultWorkspace.subnodes.assert("NewView"); //NewView = name of saved view

applicationcommand("saveworkspace", test, 0);

2) Use the below function to open the saved workspace. You can find the workspaces in the tree under View > environment > Workspaces > Default.

applicationcommand("openworkspace", NewView); //set path to NewView

Let me know how this works. It's just my best guess as to how to do this. Here's a model with the applicationcommand primed and ready to go. Running the command in the script window will open a new workspace that I saved.

open saved workspace.fsm


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

Enrique Elizaga avatar image Enrique Elizaga commented ·

@tanner.p thank you. I opened the model, changed the layout and then pressed GO on the script window assuming that it would switch me back to the saved view layout. Nothing happended. I changed it again and pressed GO, yet nothing happened either. Would you please clarify if I have to do an additional step?

0 Likes 0 ·
tannerp avatar image tannerp Enrique Elizaga commented ·

Try running the save code shown above and then opening the saved workspace. I just tested it again with this model. You can run the code in the Script window when you open it to save the workspace. Then, change the workspace, comment out lines 3-10, remove the comment from line 13, and run the code again. It should work this way.

open-saved-workspace_1.fsm

0 Likes 0 ·
Braydn T avatar image
0 Likes"
Braydn T answered Enrique Elizaga commented

@Enrique Elizaga You can use the views which is on the right side of the window when you click on the model background. You can capture a view and then select it to go back to that view. You can also right click your mouse to see your views. This won't open any default windows, but it will bring your 3D model view to the same position.


views.png (18.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.

Enrique Elizaga avatar image Enrique Elizaga commented ·

Hi @Braydn T, what I mean is switching the full layout arrangement of windows. Here my example of two different ones. If you are switching between these 2 layouts. One consists of:

  • 3d view
  • Dashboard
  • Manual
  • Script window
  • Process flow
  • Code editor

The second one consists of:

  • Manual entry or 3D view
  • Proces flow
  • Script window

It takes time to drag and drop every time you switch from one mode to the other. This is an example, my actual challenge is working with multiple global table windows, dasbhoards and process flows at the same time.

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.