Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LISP Routine to load .mns file?

58 views
Skip to first unread message

Mike Rioux

unread,
Sep 4, 2001, 4:28:33 PM9/4/01
to
I have created some toolbars and icons that will be put on our network to be
included as a standard toolbar. I would like to edit a LISP routine that
will load that menugroup and, consequently, that toolbar. I have been able
to get the toolbar to show using (command "toolbar" "mygroup.mybar" "show")
but cant get it to load in the first place.

All of our CAD users are currently using ADT 3.3 and have, in the startup
suite, a LISP routine that I'd like to edit to load the custom toolbars
(.mns file) on start-up.

I am a complete novice at LISP. How would I go about starting this process?

Thank You,

Mike Rioux


Paul D

unread,
Sep 4, 2001, 7:38:43 PM9/4/01
to
have you tried menuload-from the help file

MENULOAD Command Line

WhenFILEDIA is set to 0 (off), MENULOAD displays the following prompt on the
command line.

Enter name of menu file to load: Enter a file name


Mike Rioux <mri...@e-architect.com> wrote in message
news:4FC4DB8BFCBC6FDD...@in.WebX.maYIadrTaRb...

Scribble

unread,
Sep 5, 2001, 7:08:43 AM9/5/01
to
I use this in my <menu>.mnl file, (adapted from an unremembered source) you
need to alter for your menu name (mine is called civil.mns):

(defun civil-placemenu (/ CNT)
(setq CNT 1)
(while (< CNT 24)
(if (menucmd (strcat "P" (itoa CNT) ".1=?"))
(setq CNT (1+ CNT))
(progn
(if (> CNT 2)
(setq CNT (- CNT 2))
(setq CNT 2)
)
(menucmd (strcat "p" (itoa CNT) "=+CIVIL.pop1"))
(setq CNT 25)
)
)
)
)

(civil-placemenu)

"Mike Rioux" <mri...@e-architect.com> wrote in message
news:4FC4DB8BFCBC6FDD...@in.WebX.maYIadrTaRb...

Mike Rioux

unread,
Sep 5, 2001, 9:28:43 AM9/5/01
to
Paul:

That works fine for my desktop machine. What I want to do is have the menu
load in the background on the 50+ other CAD users without them all having to
edit their .mnl file or even use the MENULOAD command. It is far too easy
for something to go wrong and have all of their menus accidentally
"disappear". We already have 4 LISP files loading at startup from the
network. I just want to edit one of those to either load the menu that is
also on the network, or refer to another LISP file in the same directory
that will load the menu.

Are there any websites with an introduction to AutoLISP? The Visual LISP
Editor is still Greek to me.

"Scribble" <scri...@iinet.net.au> wrote in message
news:AB654887CEA37BF5...@in.WebX.maYIadrTaRb...

Paul D

unread,
Sep 5, 2001, 12:09:17 PM9/5/01
to
ok, so I guess I'm missing something. Why can't you put the menuload command
in one of the lisp files that is already loading each time?

"Mike Rioux" <mri...@e-architect.com> wrote in message

news:31CC088B4C4464B8...@in.WebX.maYIadrTaRb...

Doug Barr

unread,
Sep 5, 2001, 1:01:06 PM9/5/01
to
Add this line to your acad.lsp:
(command "menu" "c:/acad2000/support/acad.mns")
substituting the appropriate path, etc
-doug

"Paul D" <pa...@lbeci.com> wrote in message
news:9D346B40CC1FDA2D...@in.WebX.maYIadrTaRb...

Mike Rioux

unread,
Sep 5, 2001, 2:44:59 PM9/5/01
to
Does it matter which one? See my response to Doug:

"Paul D" <pa...@lbeci.com> wrote in message
news:9D346B40CC1FDA2D...@in.WebX.maYIadrTaRb...

Mike Rioux

unread,
Sep 5, 2001, 2:44:55 PM9/5/01
to
I would like to do as Paul has suggested and add to one of the LISP files
already loading.

You may have to hold my hand more than you think. All I know how to do is
edit Macros associated with toolbar buttons. As I stated earlier. I am not
familiar with LISP.

Adding the line that Doug suggested results in ONLY the mycustom.mns file
and toolbars loading...not the standard acad.mns from C:/ AND mycustom.mns
from the K:/ (network) drive. I'm sure that if I edited my local acad.mns
file so that, in addition to the standard menus, my custom menu would load
as well.

Here is the body of the LISP file that currently loads from the network on
everyone's machine.

;* XXXX.LSP - XXXX Quick Keystrokes Working Command Lisp File

(DEFUN C:q () (COMMAND "list")(princ))
(DEFUN C:TM0 () (COMMAND "TILEMODE" "0")(princ))
(DEFUN C:TM1 () (COMMAND "TILEMODE" "1")(princ))
(DEFUN C:VR () (COMMAND "View" "Restore")(princ))
(DEFUN C:VS () (COMMAND "View" "W")(princ))
(DEFUN C:ZA () (COMMAND "ZOOM" "A")(princ))
(DEFUN C:ZE () (COMMAND "ZOOM" "E")(princ))
(DEFUN C:ZI () (COMMAND "ZOOM" "2X")(princ))
(DEFUN C:ZO () (COMMAND "ZOOM" ".5X")(princ))
(DEFUN C:ZP () (COMMAND "ZOOM" "P")(princ))
(DEFUN C:ZW () (COMMAND "ZOOM" "W")(princ))
(DEFUN c:dd () (command "ddedit")(princ))
(DEFUN c:c () (command "copy")(princ))
(DEFUN c:ci () (command "circle")(princ))
(DEFUN c:kn () (keynotes)(princ))
(DEFUN C:BOSS () (LOAD "LAYRBOSS.lsp")(princ))

Can I add to this file? Adding (command "menu" "K:/LISP/mycustom.mns")
results in ONLY the mycustom.mns loading. I'm trying to make this as much
of a no-brainer as possible for the other users. The only reason for the
menugroup to load is to be able to select the toolbars that are part of that
group not to place a pulldown menu on the menu bar.

It would have to do the following, as Paul has stated, change the filedia to
0 then "menuload" the mycustom.mns file, then filedia back to 1.

The users would simply have to right click on their toolbars to select from
the new set of toobars that I have created.

Thank you for your help,

Mike

"Doug Barr" <db...@provinceauto.com> wrote in message
news:C2D6D3DEDE26F424...@in.WebX.maYIadrTaRb...

Paul D

unread,
Sep 5, 2001, 3:07:30 PM9/5/01
to
yes, you can put the code in any .lsp file you have that is autoloaded at
startup
the problem with the menu command is that is loads a full menu so will not
allow acad.mns to load since it thinks you are replacing it with the menu
you chose. the menuload command allows for partial menus so will allow the
acad.mns to load. you could add the following lines to the end of you lsp
file
(setvar "filedia" 0)
(menuload "full path and file name of your partial menu")
(menuload "any other partial menus you want loaded")
(setvar "filedia" 1)
I suppose good programming would actually store the value of filedia then
set it to 0 then restore to its original value. I'll leave that option up to
you

We have a small office here so we just tell everyone how to load the menus
from the server so I don't know if this way actually works. Let me know what
happens.

"Mike Rioux" <mri...@e-architect.com> wrote in message

news:3E42D2411A2C1039...@in.WebX.maYIadrTaRb...

R. Robert Bell

unread,
Sep 5, 2001, 5:18:35 PM9/5/01
to
Don't forget you will get an error if you attempt to MenuLoad a menu that is
already loaded. The cheater's way out is to use MenuUnload first...

--
R. Robert Bell, MCSE
http://www.acadx.com


"Paul D" <pa...@lbeci.com> wrote in message

news:C78562B1213DC712...@in.WebX.maYIadrTaRb...

Paul D

unread,
Sep 5, 2001, 5:21:06 PM9/5/01
to
ahh, good point
so you should add a (if (menugroup groupname) check first. maybe this
routine should be its own routine called from the .lsp file. hmmm

"R. Robert Bell" <rob...@acadx.com> wrote in message
news:D732AE373C085C06...@in.WebX.maYIadrTaRb...

Paul D

unread,
Sep 5, 2001, 9:03:44 PM9/5/01
to
not really, any autoloaded .lsp file will work. Although you don't want your
code spread all around just to keep things tidy

Mike Rioux <mri...@e-architect.com> wrote in message

news:64F08EA8CEECD723...@in.WebX.maYIadrTaRb...

Mike Rioux

unread,
Sep 6, 2001, 7:59:13 AM9/6/01
to
This string worked where mycustom is the .mns/c file prefix. Thanks for
your help!

(setvar "filedia" 0)
(COMMAND "menuunload" "mycustom")
(COMMAND "menuload" "mycustom")
(setvar "filedia" 1)

Mike

"Paul D" <pa...@lbeci.com> wrote in message

news:399D61C2F9F94CBF...@in.WebX.maYIadrTaRb...

Brian Smith

unread,
Sep 8, 2001, 9:31:18 AM9/8/01
to
Mike,

On a completely different tack, If your staff all use the same base menu you
can manually load your partial menus using the menuload command, get the
autocad desktop layout and options the way you want them and export a
profile to K: drive. Then create a desktop shortcut that starts autocad
using the /p <profile path and name> switch. Then email the shortcut to
other users.

Regards
Brian Smith

Paul D <pa...@lbeci.com> wrote in message

news:9D346B40CC1FDA2D...@in.WebX.maYIadrTaRb...

0 new messages