Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Menu swapping - migrating to CUIX from MNS

7 REPLIES 7
Reply
Message 1 of 8
rodderscas
1096 Views, 7 Replies

Menu swapping - migrating to CUIX from MNS

I read Robert Bell's document “Migrating from MNU to the CUI” (Autodesk University 2007) with interest. I have been using 2005 up until now and I am finally forcing myself to get to grips with 2010. I know, it is ridiculous that I have waited this long.

Still using a tablet, still loving it. I managed to get it to work after much trial and error through the CUI transfer interface.

My customizing makes use of a lot of swapping pull-down menus, which swap in and out based on current later setting.

A typical command would be:

(MENUCMD "P15=RCASPOPS.mfireeqp") where RCASPOPS is my swapping menu loaded at POP15.

Then I would use (MENUCMD "P15=*") to force the “mfireeqp” area of the pull-down menu to display.

Trouble is, when I CUIload RCASPOPS, it does not seem to recognize the various areas of the menu.

Here is a part of that subsection of RCASPOPS:

***MFIREEQP
[FireProtEquipLayers]
[--]
[0]0;
[defpoints]defpoints;
[X-Refs]x----ref;
[--]
[Fire Prot. Total L&ayers - *]h-f*,*|h-f*;
[Fire Prot. Equip. L&ayers - *]h-fe*,*|h-fe*;
[--]
[->Fire Hose Ca&binet Group]
[&Fire Hose Cabinets - *]h-fe-cab*,*|h-fe-cab*;
[&STANDARD]h-fe-cab;
  • h-fe-cab-???,*|h-fe-cab-???,h-fe-cab,*|h-fe-cab;
    [&EXIST]h-fe-cab-e;
  • h-fe-cab-???-e,*|h-fe-cab-???-e,h-fe-cab-e,*|h-fe-cab-e;
    [&BASE]h-fe-cab-s;
  • h-fe-cab-???-s,*|h-fe-cab-???-s,h-fe-cab-s,*|h-fe-cab-s;
    [&NEW]h-fe-cab-n;
  • h-fe-cab-???-n,*|h-fe-cab-???-n,h-fe-cab-n,*|h-fe-cab-n;
    [&PLANNED]h-fe-cab-p;
  • h-fe-cab-???-p,*|h-fe-cab-???-p,h-fe-cab-p,*|h-fe-cab-p;
    [&REMOVE]h-fe-cab-x;
    [<-*]h-fe-cab-???-x,*|h-fe-cab-???-x,h-fe-cab-x,*|h-fe-cab-x;


    Where am I going wrong?

    Typically the whole of RCASPOPS is loaded but when I try to force it to display, the whole of it pops on the screen (well, the top of the file does anyway) and not just the subsection I want.

    Is this a syntax issue with the newer AutoCad?

    Also notice that I use the -> and <- for fly-out sections of the menu - is there a syntax issue with this?

    I notice that the future support of drop down swapping menus is not guaranteed. What is the alternative?

    I really would appreciate any hints, thanks in advance.

    Oh, and happy new year!
  • 7 REPLIES 7
    Message 2 of 8
    rb-arch
    in reply to: rodderscas

    I sympathize with you. I started with V1.4 in 1984 and have been programming AutoCAD since 1986. Even today, I despise each new software release. The transition is far better now than before, since some early releases almost required a COMPLETE rewrite! For me that was thousands of lines of code in lisp and menus. The migration feature has helped tons!

    However, I have just installed 2010 and all of a sudden a lisp routine I use several times in each drawing session no longer works. Simply put, I can no longer pop a menu using the lisp "menucmd". It is obvious the new POP menu is loaded and ready to be popped, since the new title appears in the menu bar and can be manually selected. But anyway, here is the code to load the new POP menu in the 14th slot.

    (menucmd "p14=Accent.p2plan1") Where "p14" is the POP menu slot, "Accent" is the menu group (Yes it is loaded), and "p2lplan1" is the header for the particular menu section.

    For years, the current menu loaded in the numbered slot above has been pulled down by the following code:
    (menucmd "$p14=*")
    Currently, no menu is pulled down, regardless of the slot number. This is true running the code within a lisp routine or manually typing the code in at the Command line.

    Below is what the "Help" file says under "Swap and Insert Pull-Down Menus":
    "You can use the $Pn=* special command from within any macro to force the menu currently assigned to area POPn to be displayed."

    Although "Help" leaves out the quotes needed for the code, it continues:
    "NoteThe swapping of pull-down menus does not conform to the Microsoft® user interface guidelines and is not guaranteed to be available in future releases of the program."

    Surely if the swapping capability has been jerked by Autodesk in 2010, there would be an additional line in the help file saying so. Right?

    Any help would be appreciated!
    R Barron
    Message 3 of 8
    rb-arch
    in reply to: rodderscas

    I would just add to my post above, the "$pn=xxx" in the manual refers to a macro only. The function within LISP used in combination with "menucmd", does not require the "$". Therefore, the code used for years in my application to pull the menu down prior to 2010, would be: (menucmd "p14=*"). It is strange, (menucmd "p0=*") works, but no other number does.

    Another clue - I can boot up in Acad 2009, using the very same custom menus and Lisp files that were migrated into my Acad 2010 installation, and this older version works successfully, including the "menucmd" function noted above. I am aware that Autocad 2010 uses a new compiled menu format (.cuix), and this, along with the above, makes me think there is a problem with the new file format.

    rb-arch
    Message 4 of 8
    rb-arch
    in reply to: rodderscas

    I just noticed something about your menu header. I have my menus structured like so:

    ***POP13
    **FIRSTMENU
    [Menu Bar Title]
    [--]
    [Pulled Down Menu Title]
    [ First Menu Choice](alert "Do something")
    [and so forth

    As I recall, your header took on the following format:

    ***MFIREEQP
    [Some Text]
    [etc.

    It seems you are not naming a particular menu slot for the menu and therefore, the results are not as expected. Also, there is no subsection menu designated, and consequently subsections won't show.

    I suggest trying the following format:

    ***POPn (where "n" is the target menu slot or sequence number 1-16. Notice three "***".)
    **MFIREEQP (the two "**" indicate the start of a subsection under the POPn slot.
    [Menu Bar Title]
    [etc.}

    **MFIREEQP-2 (this would be the second menu subsection under the same "n" menu slot number.)
    [Menu Bar Title}
    [etc.}
    Message 5 of 8
    rodderscas
    in reply to: rodderscas

    I just heard over the phone from an Autodesk technical support guy that you had been posting on this subject, please accept my apologies for not reading and replying sooner. I think the Autodesk guy told me your name was Rob Baron, sorry if that is incorrect. BTW the Autodesk guy told me that he sent me an email - which has not arrived and I checked the junk files at all locations!

    Frustration with Autodesk is major for me because I like you have invested 1000's of hours in menu customization and the bozos in the development team have decided in their infinite wisdom to drop an essential part of what makes our working life tick - swapping pull-down menus. There is some ridiculous statement in the help file that states support for this is not guaranteed in FUTURE issues of the product. It certainly does not say it will not work in 2010. I am interested in what you say about 2009 still responding to the menucmd calls though - I have 2005, 2008, 2009 and 2010 loaded - although I still use 2005 because I am only now trying to move my customizing forward. A question will be whether I should try to alter my workflow based upon this RETROGRADE step by Autodesk, or simply load 2009 and try to make THAT work. I guess finding a solution for the 2010 environment is the sensible thing to do, seeing as I am a subscription member and I am going to be getting the next exciting installment of "what can they mess with now on this otherwise excellent product".

    Your comments below about using a double asterisk as a sub-menu header sound great but alas this makes no difference. I have been running 2005 with triple asterisk sub-menu headers for years. I tried it with a small pop menu sample loading at P15, having two **sub-menu sections and all it did was load the first at P15 and the second at P16 (cuix menus indeed).

    The Autodesk guy (I do wish I had written down his name) said that if he took my attitude that this is a BUG in 2010 to the development team, they would react that it is not supported already because of the xml language swap from C++. I expect the long and short of it is that they simply neglected to drop in the code required for our beloved menu swapping to work. I do not accept or believe that this would have been complicated.

    My wife bought me a 28" monitor for Christmas - I have it running at a really high resolution, which means that I might be able to load enough menus across the top of the screen to make this work. I can probably combine some of the sub-menu areas into one, that sort of thing.

    Anyway thanks again for your interest, I am so glad to hear that another operator out there realized the wonderful advantages swapping menus can offer. As far as Autodesk is concerned, I am frankly disgusted with them, and if they did not control the market, I would consider swapping product instead of menus.

    cheers
    Message 6 of 8
    rgrainer
    in reply to: rodderscas

    Roderic
    First of let me let you know, that for me, menu swapping is still possible in 2010. I originally started doing this with an mnu file and after importing it and converting to a cui or cuix it still is working. So yes i to have invested lots of hours swapping and configuring my menus. The other thing to know is that i haven't worked on it for a while so i might miss something in explaining how it actually works for me.

    This is how i do it and it seems to be along the lines of what was stated earlier about the use of the 3 asterisks and then the 2 asterisks
    Except that in my partial menu (called "mypartial") has it's own POP0 section. This starts with the 3 asterisks as shown below. Each section below that has two asterisks. And all menus that are going to be swapped in, are below the POP0 section.

    This is a brief sample of my partial menu:

    // Default AutoCAD NAMESPACE declaration:
    //
    ***MENUGROUP=MYPARTIAL
    //
    ;;;;;AUX and BUTTONS would go here

    ***POP0
    **MYsnap
    [Osnap]
    [RESET CURSOR MENU\tXX]$P0=mypartial.wralegendmenu $p0=*
    [--]
    ///[&Object Snap Cursor Menu]
    [->Settings and Adjustments]
    etc etc
    [<-MID of ENDP/PERP ENDP]'CAL (END+PER)/2;
    [--]
    ID_OsnapEndp [&Endpoint]_endp
    ID_OsnapMidp [&Midpoint]_mid
    ;;;;;;;;;;;;;;;;;;;more items to be added as needed. This is basically my own version of the default Osnap menu with my own flyouts added

    **mypoints
    [MYPOINTS]
    [Reset Cursor Menu \tXX]$P0=mypartial.myegendmenu $p0=*
    [--]
    AECC_PrjMnuPal [&Menu Palettes...]^c^c^c^p_aecmenupalmgr

    **xxrefplum
    [xxrefplum]
    ID_Cursrxref [RESET CURSOR MENU\tXX]$P0=mypartial.wralegendmenu $p0=*
    [--]
    [Base-ADJOIN Color As is]^c^c^PXadjoin_pc;


    Each sub menu has a "RESET CURSOR MENU" at the top of it. This is how i get swapped menus back to a default configuration.
    The other thing is to have a mnl file that controls which menu gets called. I have this at the bottom of the "mypartial.mnl" file

    (menucmd "P0=mypartial.MYsnap")
    (menucmd "A1=mypartial.AUX1")
    (menucmd "A2=mypartial.AUX2")
    ;;;;;and add more AUX items if needed

    See if the above helps you. Like I said it can still be done If you need more info post back and I'll try to help.

    Richard



    Message 7 of 8
    rodderscas
    in reply to: rodderscas

    Thank you very much for taking the time to look at this for me I appreciate it.

    I tried adding my Pop0 to the top of one of my smaller menus and included below that two sub-headings with ** prefixes - but alas all that happened was when loaded (at P18) from .mns to .cuix it read each sub-heading as an individual menu, and placed each one on the screen as independent menus (P18 and P19), not sub-menus contained in P18.

    So as far as I can see, the addition of the Pop0 had no real beneficial affect.

    Currently I am working on producing a large number of individual menu files that can be present at all times, i.e. breaking each sub-menu into an individual menu file that will be always on-screen. That will be a suitable workaround.

    I am told that I can probably achieve a good alternative with the ribbon menu, but I do not have time to learn that right now.

    cheers anyway and thanks again.
    Message 8 of 8
    hypersonic
    in reply to: rodderscas

    I am having the exact same problem, if you found a solution, please let us know.

    Thanks!

    Can't find what you're looking for? Ask the community or share your knowledge.

    Post to forums  

    Autodesk Design & Make Report

    ”Boost