Hello,
I have created two new workspace by copying settings (menues and toolbars) from AutoCAD Standard workspace. Here are some codesnipes
Workspace baseWorkspace = cs.getWorkspace(WSNAMEBaseWorkspace); Workspace newWS = new Workspace(cs, newWSName); foreach (WorkspacePopMenu currPopMenu in baseWorkspace.WorkspacePopMenus) newWS.WorkspacePopMenus.Add(currPopMenu); foreach (WorkspaceToolbar currToolbar in baseWorkspace.WorkspaceToolbars) newWS.WorkspaceToolbars.Add(currToolbar); newWS.WorkspaceQuickAccessToolbar = baseWorkspace.WorkspaceQuickAccessToolbar.Clone(); newWS.MenuBar = MenuBarToggle.on; retVal = true;
then I save the modified cui
if (cs.IsModified) cs.Save(); for (int i = 0; i < numPartialFiles; i++) { if (partials[i].IsModified) partials[i].Save(); } Application.ReloadAllMenus();
and set the new created workspace as current workspace (Application.SetSystemVariable("WSCURRENT", wsname);)
The code seems to work except for the filetab. When switching thorugh workspaces with no ribbon in the workspace-control-window filetab looses state and isn't displayed. Switching to a ribbon workspace and back to any classic workspace filetab is continuous displayed.
My workaround at the moment is to SendStringToExecute _FILETABCLOSE and after that _FILETAB.
I have noticed that there is a palette under options->workspaces called filetab. This palette is that to display true.
I'm open to suggestions?
Have a nice day
Thosti