using menuload on a menu button

using menuload on a menu button

Anonymous
Not applicable
345 Views
10 Replies
Message 1 of 11

using menuload on a menu button

Anonymous
Not applicable
Hi,
I have written a partially loadable menu for use in R13. The menu is for the
use of the autocad designers at work, is there any way that I can load the
menu with a button on the toolbar either using a lisp routine or menu macro
rather than doing it manually through menuload? if so how?

thanks in advance
MICK
0 Likes
346 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
I don't know about the toolbar part, but from the command line you can use
something like this in your ACAD.lsp:

(defun C:MNUL ()
(setvar "cmdecho" 0)
(setvar "filedia" 0)
(command "menuload" "yourmenu")
(setvar "filedia" 1)
(princ)
)

HTH
--
Dave D

Mick wrote in article
<[email protected]>...
> Hi,
> I have written a partially loadable menu for use in R13. The menu is for
the
> use of the autocad designers at work, is there any way that I can load
the
> menu with a button on the toolbar either using a lisp routine or menu
macro
> rather than doing it manually through menuload? if so how?
>
> thanks in advance
> MICK
>
>
>
0 Likes
Message 3 of 11

Anonymous
Not applicable
Thaks for the reply Dave,
that loads the menu, but how can i load the pull down menu into my standard
menu from that point using code?

thanks in advance mick
0 Likes
Message 4 of 11

Anonymous
Not applicable
Mick wrote in article
<[email protected]>...
> Thaks for the reply Dave,
> that loads the menu, but how can i load the pull down menu into my
standard
> menu from that point using code?
>
> thanks in advance mick
>
I'm not sure whether you are overwriting the standard menu or adding to it,
but this is what I use to do both. Make sure that you have the menugroup
declaration in your menu, such as:

***MENUGROUP=AC_LMS

and create a MNL file with the same name as your menu, and use the
following as a guide for the contents, and your pull downs should appear
automatically. You can also put autoloading statements in the MNL file.
Replace AC_LMS with yourmenu name.

;;; AutoLISP routines used by the AC_LMS conversion Menu.

;;; This file is loaded automatically following the menu AC_LMS

;;; Overrides the ACAD Menu buttons and places the
;;; LMS pulldown menus after the help pulldown menu
;;; POP0 is handled on an individual basis in menus

(princ "\nAC_LMS menu loaded ") ;indicates that menu
loaded
(princ "\nAC_LMS menu conversion & utilities ") ;indicates that your
mnl...

(menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
(menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
(menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
(menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
(menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
(menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as Pop13
(menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as Pop14
(menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as Pop15
(menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as Pop16

(princ "loaded.") ;...is loaded

Hope this gives you some ideas.
--
Dave D
0 Likes
Message 5 of 11

Anonymous
Not applicable
David,

Good Tip!

Question: Can you also replace the ***ACCELERATORS section the same way,
with the (menucmd) syntax? This would be very helpful to replace Accelerator
Hotkeys from a Partial menu.

Regards,
--
Phillip Kenewell
CAD Systems Technician
Air Gage Company
[email protected]
===================
> Not < a Member of the AutoDESK
Discussion Forum Moderator Program

David Doane wrote in message
news:01bf10d2$6a921b80$2a57d2d0@lms-1...
> and create a MNL file with the same name as your menu, and use the
> following as a guide for the contents, and your pull downs should appear
> automatically. You can also put autoloading statements in the MNL file.
> Replace AC_LMS with yourmenu name.
> (menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
> (menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
> (menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
> (menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
> (menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
> (menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as Pop13
> (menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as Pop14
> (menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as Pop15
> (menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as Pop16
0 Likes
Message 6 of 11

Anonymous
Not applicable
Not that I know of. Actually I have been unable to find any info in 'help'
on just what sections of the menu may be partially loaded.

To my knowledge, P is for pulldowns, A for Auxilliary, B for buttons, S for
Screen, and T for tablet. I don't know of a key for Accelerators.

It seems like there was a thread on that some time ago.

Dave D

Phil Kenewell wrote in article
<[email protected]>...
> David,
>
> Good Tip!
>
> Question: Can you also replace the ***ACCELERATORS section the same way,
> with the (menucmd) syntax? This would be very helpful to replace
Accelerator
> Hotkeys from a Partial menu.
>
> Regards,
> --
> Phillip Kenewell
> CAD Systems Technician
> Air Gage Company
> [email protected]
> ===================
> > Not < a Member of the AutoDESK
> Discussion Forum Moderator Program
>
> David Doane wrote in message
> news:01bf10d2$6a921b80$2a57d2d0@lms-1...
> > and create a MNL file with the same name as your menu, and use the
> > following as a guide for the contents, and your pull downs should
appear
> > automatically. You can also put autoloading statements in the MNL
file.
> > Replace AC_LMS with yourmenu name.
> > (menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
> > (menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
> > (menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
> > (menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
> > (menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
> > (menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as
Pop13
> > (menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as
Pop14
> > (menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as
Pop15
> > (menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as
Pop16
>
>
>
0 Likes
Message 7 of 11

Anonymous
Not applicable
As I understand it you can use:

(menucmd "GACAD.ACCELERATORS=YOURGROUPNAME.ACCELERATORS")

But it only works if you call it after s::startup. To get around that I
unload and reload my custom partial menu (which contains my accelerators)
every drawing startup.

Dan

David Doane wrote in message
news:01bf11b0$f18f9b60$3457d2d0@lms-1...
> Not that I know of. Actually I have been unable to find any info in
'help'
> on just what sections of the menu may be partially loaded.
>
> To my knowledge, P is for pulldowns, A for Auxilliary, B for buttons, S
for
> Screen, and T for tablet. I don't know of a key for Accelerators.
>
> It seems like there was a thread on that some time ago.
>
> Dave D
>
> Phil Kenewell wrote in article
> <[email protected]>...
> > David,
> >
> > Good Tip!
> >
> > Question: Can you also replace the ***ACCELERATORS section the same way,
> > with the (menucmd) syntax? This would be very helpful to replace
> Accelerator
> > Hotkeys from a Partial menu.
> >
> > Regards,
> > --
> > Phillip Kenewell
> > CAD Systems Technician
> > Air Gage Company
> > [email protected]
> > ===================
> > > Not < a Member of the AutoDESK
> > Discussion Forum Moderator Program
> >
> > David Doane wrote in message
> > news:01bf10d2$6a921b80$2a57d2d0@lms-1...
> > > and create a MNL file with the same name as your menu, and use the
> > > following as a guide for the contents, and your pull downs should
> appear
> > > automatically. You can also put autoloading statements in the MNL
> file.
> > > Replace AC_LMS with yourmenu name.
> > > (menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
> > > (menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
> > > (menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
> > > (menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
> > > (menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
> > > (menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as
> Pop13
> > > (menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as
> Pop14
> > > (menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as
> Pop15
> > > (menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as
> Pop16
> >
> >
> >
0 Likes
Message 8 of 11

Anonymous
Not applicable
I have never had that work. And as I understand it from this newsgroup, it
was never intended to work. (why I don't know - it should!)
I gave up on the forced reload, as it added extra time to every load, and
just replaced the whole section in the acad menu (local version on my
machine).

A minor inconvenience...

P. Farrell
0 Likes
Message 9 of 11

Anonymous
Not applicable
It actually works for us in R14. I have the custom menus in a shared network
directory and I just call (command "_.menuunload" "menu") and (command
"_.menuload" "menu") in the s::startup. The extra load time is worth the
global office accelerators.

Peter Farrell wrote in message
news:[email protected]...
> I have never had that work. And as I understand it from this newsgroup,
it
> was never intended to work. (why I don't know - it should!)
> I gave up on the forced reload, as it added extra time to every load, and
> just replaced the whole section in the acad menu (local version on my
> machine).
>
> A minor inconvenience...
>
> P. Farrell
>
>
0 Likes
Message 10 of 11

Anonymous
Not applicable
Well, ain't that a B.....!

I tried exactly that and it didn't work in A2K. I received an AutoLISP
error message when the mnl loaded.

Just for kicks, I copied your statement under mine, THEN I discovered I had
left off the closing quotes. Grrrrrr.

Now it works just fine, and with the menu loading in the normal order,
which is before S::Startup is loaded.

So to repost what I did for Mick, the mnl entries would be:

;;; AutoLISP routines used by the AC_LMS conversion Menu.

;;; This file is loaded automatically following the menu AC_LMS

;;; Overrides the ACAD Menu buttons and places the
;;; LMS pulldown menus after the help pulldown menu
;;; POP0 is handled on an individual basis in menus

(princ "\nAC_LMS menu loaded ") ;indicates that menu loaded
(princ "\nAC_LMS menu conversion & utilities ") ;indicates that mnl...

(menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
(menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
(menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
(menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
(menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
(menucmd "GACAD.ACCELERATORS=AC_LMS.ACCELERATORS") ;replaces ACAD.mnu ACC.
(menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as Pop13
(menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as Pop14
(menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as Pop15
(menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as Pop16

(princ "loaded.") ;...is loaded

And just for kicks, I will include what I found to be the loading order of:

Order: File: For use by:

1. acad.rx User
2. acad2000.lsp Autodesk
3. acad.lsp User
4. acad2000doc.lsp Autodesk
5. acettest.fas Express Tools (or acetutil.fas)
6. acetauto.lsp Express Tools
7. acetloc.lsp Express Tools
8. acaddoc.lsp User
9. mymenu.mnc User
10. mymenu.mnl User
11. mylisp.lsp User
12. acad.mnc Autodesk
13. acad.mnl Autodesk
14. acetmain.mnc Express Tools
15. acetmain.mnl Express Tools
16. acad.lsp s::startup User

Thanks for the wakeup call, Dan.
--
Dave D

Dan Allen wrote in article
<[email protected]>...
> As I understand it you can use:
>
> (menucmd "GACAD.ACCELERATORS=YOURGROUPNAME.ACCELERATORS")
>
> But it only works if you call it after s::startup. To get around that I
> unload and reload my custom partial menu (which contains my accelerators)
> every drawing startup.
>
> Dan
>
>
> David Doane wrote in message
> news:01bf11b0$f18f9b60$3457d2d0@lms-1...
> > Not that I know of. Actually I have been unable to find any info in
> 'help'
> > on just what sections of the menu may be partially loaded.
> >
> > To my knowledge, P is for pulldowns, A for Auxilliary, B for buttons, S
> for
> > Screen, and T for tablet. I don't know of a key for Accelerators.
> >
> > It seems like there was a thread on that some time ago.
> >
> > Dave D
> >
> > Phil Kenewell wrote in article
> > <[email protected]>...
> > > David,
> > >
> > > Good Tip!
> > >
> > > Question: Can you also replace the ***ACCELERATORS section the same
way,
> > > with the (menucmd) syntax? This would be very helpful to replace
> > Accelerator
> > > Hotkeys from a Partial menu.
> > >
> > > Regards,
> > > --
> > > Phillip Kenewell
> > > CAD Systems Technician
> > > Air Gage Company
> > > [email protected]
> > > ===================
> > > > Not < a Member of the AutoDESK
> > > Discussion Forum Moderator Program
> > >
> > > David Doane wrote in message
> > > news:01bf10d2$6a921b80$2a57d2d0@lms-1...
> > > > and create a MNL file with the same name as your menu, and use the
> > > > following as a guide for the contents, and your pull downs should
> > appear
> > > > automatically. You can also put autoloading statements in the MNL
> > file.
> > > > Replace AC_LMS with yourmenu name.
> > > > (menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
> > > > (menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
> > > > (menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
> > > > (menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
> > > > (menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
> > > > (menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as
> > Pop13
> > > > (menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as
> > Pop14
> > > > (menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as
> > Pop15
> > > > (menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as
> > Pop16
> > >
> > >
> > >
>
>
>
0 Likes
Message 11 of 11

Anonymous
Not applicable
Thanks Everyone! This will really help out - I've been trying to figure out
a way to do this for a while.

--
Phillip Kenewell
CAD Systems Technician
Air Gage Company
[email protected]
===================
> Not < a Member of the AutoDESK
Discussion Forum Moderator Program

David Doane wrote in message
news:01bf11fd$0a6d5a40$3457d2d0@lms-1...
> (princ "\nAC_LMS menu loaded ") ;indicates that menu loaded
> (princ "\nAC_LMS menu conversion & utilities ") ;indicates that mnl...
>
> (menucmd "B1=AC_LMS.buttons1") ;replaces ACAD.mnu buttons1
> (menucmd "B2=AC_LMS.buttons2") ;replaces ACAD.mnu buttons2
> (menucmd "B3=AC_LMS.buttons3") ;replaces ACAD.mnu buttons3
> (menucmd "B4=AC_LMS.buttons4") ;replaces ACAD.mnu buttons4
> (menucmd "A2=AC_LMS.aux2") ;replaces ACAD.mnu aux2
> (menucmd "GACAD.ACCELERATORS=AC_LMS.ACCELERATORS") ;replaces ACAD.mnu ACC.
> (menucmd "P13=+AC_LMS.pop1") ;adds AC_LMS.mnu Pop1 to ACAD.mnu as Pop13
> (menucmd "P14=+AC_LMS.pop2") ;adds AC_LMS.mnu Pop2 to ACAD.mnu as Pop14
> (menucmd "P15=+AC_LMS.pop3") ;adds AC_LMS.mnu Pop3 to ACAD.mnu as Pop15
> (menucmd "P16=+AC_LMS.pop4") ;adds AC_LMS.mnu Pop4 to ACAD.mnu as Pop16
0 Likes