Partial CUI, display menu at specific position

I have a partial cui file containing a menu. After I load this file (cuiload), the menu is appended to the menu bar and appears right of "help". But I would like to have it at 2nd position, between "file" and "edit". For this, I use the following commands. The 1st command removes my menu from the menu bar, the 2nd command inserts it at position 2.

  • (menucmd "Gmygroup.pop1=-")
  • (menucmd "Gmygroup.pop2=-")
    This works, but seems to be only temporary, because if I use the cui command and simply press OK, my menu is again displayed to the very right of the menu bar. I know that I can change the menu order manually using the cui command, but the point is, that this should be done on many computers, and therefore it would be very helpful to automate this (by lisp?). Any idea how this could be accomplished?

Comments

  • Is the behavior affected by the value of WSAUTOSAVE?

  • @Owen Wengerd said:
    Is the behavior affected by the value of WSAUTOSAVE?

    no, same effect for wsautosave true or false.

  • Perhaps I don't understand the question but....

    Why not just drag&drop it in the sequence you want while using the customize interface ?

    Open Customize, open workspaces, select the workspace in question, open up the menus and just drag and drop things in the order you want them. Afterwhich you just have to export the profile by means of the profile manager, and import it at the users.

  • The partial cui file contains menus for our application, which is used by our customers in many different configurations: different cad-versions, different versions of our application, some customers use other applications as well ... therefore it's not practicable to create one profile that fits all needs.

    So our approach is to use a (lisp-)command to show our menu at a specific position. "menucmd" does exactly what we want, but the changes are gone after the next call to the cui-command. If the chages made by "menucmd" were written permanently to the cui file, the problem would been solved.

  • Oh I see.

    There's of course a big difference if something is meant for use in company or for customers where indeed you have far less control what they have running, what additional add-ons they have or even which version of Bricscad they have. This vital information wasn't included in your original post and therefor I had no way of knowing that.

    By the way, if your customers can have all kinds of different things going on then some will at no doubt have multiple workspaces.
    Is it the idea that your menu gets included in every workspace in that second pull down menu place ?
    Does it also have to take into consideration if you have customers have Briscad or Windows set up in different languages?

    One way I can think of that would be fully automatic would be to overwrite the customer main CUI wedging your menu in where you want it, nasty when you think of it and not something that is easily pulled off.

    A better way would be to have a line added to the on_start.LSP or on_doc.lsp that does the menucmd thing. This should means that even if CUI is called then it will rectify itself by either the next start of the program or the next drawing that it opens.

    By the way, any particular reason you want it to be in the 2nd place instead of at the end?
    If you're customers can't find your menu because it isn't in the 2nd place you need smarter customers. ;)

  • Maybe an MNL file is the way to go?

  • @Peter_DV said:
    A better way would be to have a line added to the on_start.LSP or on_doc.lsp that does the menucmd thing. This should means that even if CUI is called then it will rectify itself by either the next start of the program or the next drawing that it opens.

    Yes, that's what I'm going to do. Further, I want to implement an event handler, so that the menus also get reloaded after the cui command.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!