Author Topic: Load Ribbon and menu in all workspaces  (Read 6699 times)

0 Members and 1 Guest are viewing this topic.

therealjd

  • Mosquito
  • Posts: 11
Load Ribbon and menu in all workspaces
« on: August 23, 2011, 10:39:38 AM »
 have an enterprise menu loaded into my profile. I can get the menu to load, but the tab/panel for my ribbon does not show up, unless i call it up through the cui editor and add it to the current workspace. Is there a way to ensure the menu shows up all the time if the menubar is set to 1. Same goes for the ribbon. i'd like the enterprise ribbon tab to show up when the ribbon is active (ie not in AutoCAD classic mode)
 
i've come across some code at another forum:
 
(defun c:commandname (/)
(setvar "cmdecho" 0)
(command "cuiunload" "menuname1" "cuiload" "menuname2") ;menuname1 is the title of the menu, menuname2 is the filename of the menu (w/o the .cuix)
(menucmd "P20=+menuname1.pop1")(menucmd "P21=+menuname1.pop2") ;add all the pulldownmenu's, in this case two
(setq ws (getvar "wscurrent")) ;store the name of the current workspace
(command "-wssave" ws "yes") ;save the current workspace
(setvar "wscurrent" ws) ;restore the current workspace
(setq ws nil) ;clear saved workspace
(setvar "cmdecho" 1)
(princ)
)
 
This seems to load the menu drop-down, but not the ribbon.

efernal

  • Bull Frog
  • Posts: 206
Re: Load Ribbon and menu in all workspaces
« Reply #1 on: August 23, 2011, 10:51:07 AM »
try
(command "ribbon")  to show
(command "ribbonclose") to close
e.fernal

Crank

  • Water Moccasin
  • Posts: 1503
Re: Load Ribbon and menu in all workspaces
« Reply #2 on: August 23, 2011, 11:19:38 AM »
Or:
Code: [Select]
$M=$(if,$(and,$(>,$(getvar,ribbonstate),0)),^C^C_ribbonclose,^C^C_ribbon)
[...]
 
i've come across some code at another forum:
 
(defun c:commandname (/)
(setvar "cmdecho" 0)
(command "cuiunload" "menuname1" "cuiload" "menuname2") ;menuname1 is the title of the menu, menuname2 is the filename of the menu (w/o the .cuix)
This only recompiles your menu (= slowwww)
Quote
(menucmd "P20=+menuname1.pop1")(menucmd "P21=+menuname1.pop2") ;add all the pulldownmenu's, in this case two
It's not necessary to add the pulldowns over and over again: just save them in your workspace
Quote
(setq ws (getvar "wscurrent")) ;store the name of the current workspace
(command "-wssave" ws "yes") ;save the current workspace
(setvar "wscurrent" ws) ;restore the current workspace
(setq ws nil) ;clear saved workspace
This doesn't anything!

You don't need lisp to setup or restore your environment every time. Everything can be done with a profile and some workspaces.
Make everything how you want it. Add Acad.cuix, acetmain.cuix, etc. as partials to your own cui. Save the profile and workspace. If you need more you can add as much workspaces as you need.

Now change your cui to enterprise (so it's write-protected).

For your main cui you should make a new cui (or use custom.cuix)

Only in complex situations you need more profiles to load or uload parts, but it's faster and easier to hide what you don't need for that workspace.
Vault Professional 2023     +     AEC Collection

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Load Ribbon and menu in all workspaces
« Reply #3 on: August 23, 2011, 11:44:20 AM »
I think the problem is where you roll out a new partial CUI under Enterprise, and you want the new tab and/or panel to be added to each users workspace without having to do it manually.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

GDF

  • Water Moccasin
  • Posts: 2081
Re: Load Ribbon and menu in all workspaces
« Reply #4 on: August 23, 2011, 02:24:14 PM »
try
(command "ribbon")  to show
(command "ribbonclose") to close


Thanks I will use this in my startup:
(if (> (getvar "ribbonstate") 0)(command "ribbonclose"))

Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Crank

  • Water Moccasin
  • Posts: 1503
Re: Load Ribbon and menu in all workspaces
« Reply #5 on: August 23, 2011, 03:51:56 PM »
I think the problem is where you roll out a new partial CUI under Enterprise, and you want the new tab and/or panel to be added to each users workspace without having to do it manually.
This doesn't have to be a problem:
As a CAD-manager you must create an extra profile. In this profile the .cuix that normally is used as enterprise.cuix is now the main.cuix
You are able to make the changes and when you're done, you'll switch back to the normal profile.

More about the CUI:
Quote
Conclusion
The CUI will make the actual customization process a matter of drag-and-drop, as long as you understand how it works. The best advice to remember is: “Do not over-think the CUI.” Careful planning of your CUI structure before deployment will yield rich benefits to your users.
Vault Professional 2023     +     AEC Collection

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Load Ribbon and menu in all workspaces
« Reply #6 on: August 23, 2011, 03:57:43 PM »
I think the problem is where you roll out a new partial CUI under Enterprise, and you want the new tab and/or panel to be added to each users workspace without having to do it manually.
This doesn't have to be a problem:
As a CAD-manager you must create an extra profile. In this profile the .cuix that normally is used as enterprise.cuix is now the main.cuix
You are able to make the changes and when you're done, you'll switch back to the normal profile.

More about the CUI:
Quote
Conclusion
The CUI will make the actual customization process a matter of drag-and-drop, as long as you understand how it works. The best advice to remember is: “Do not over-think the CUI.” Careful planning of your CUI structure before deployment will yield rich benefits to your users.

Ahhh, no.  Switching the Main/Enterprise for editing is a non-issue.

The problem I can see is despite having added the new Ribbon/toolbar/menu components through a partial CUIx to the Enterprise, the users who have constructed their own custom workspaces may not see those components unless they manually add them to their custom workspaces.  If everybody is using the same set of locked-down workspaces from Enterprise its not so much of an issue.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Crank

  • Water Moccasin
  • Posts: 1503
Re: Load Ribbon and menu in all workspaces
« Reply #7 on: August 23, 2011, 04:15:36 PM »
Yes that can be a problem.
But I think that can be solved if you add the partials of the enterprise also as partials of the main.

The enterprise CUI file, and any partial CUI files loaded into it, is readonly in the current profile. When the same CUI file is loaded as a partial to both the main and enterprise CUI files it will be read-only.
Vault Professional 2023     +     AEC Collection

therealjd

  • Mosquito
  • Posts: 11
Re: Load Ribbon and menu in all workspaces
« Reply #8 on: August 24, 2011, 09:21:31 AM »
dgorsman had it right. as far as my issue goes.

I have created a profile that my cui loaded as an enterprise. loading the profile sets it up on the profile i setup, however, changing workspaces does not show the menu or ribbon component (even though the cui is loaded). The code i posted previously was forcing the menu load each time regardless of workspace. My issue was that the ribbon component was still not showing up unless i manually added it to existing workspaces. I was hoping for some startup code that would check if the enterprise ribbon tab was loaded in the current workspace, if not, then load it. But of course that would only apply if the user was using the ribbon. (ie, if classic mode was being used for a workspace, then just load the Enterprise menu, and don't turn on the ribbon.)

Should i be including it in the default workspaces, under a profile and then exporting that profile to share with users? Does workspace information get saved in exported profiles?

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Load Ribbon and menu in all workspaces
« Reply #9 on: August 24, 2011, 11:10:27 AM »
Overwriting a profile will overwrite a users custom workspace.  If thats OK, then you may want to just add the appropriate tabs/panels/menus etc. to default workspaces in the Enterprise CUIx and have people re-create their workspaces from that.

I'm not aware of any way from LISP to directly determine if UI components are in a specific workspace, or to add them to a workspace; others may be able to provide more insight.  You might be able to parse the Profile.AWS file for appropriate XML elements but that would be a lot more work than making a quick instruction document and telling users to follow instructions.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}