Your life will be a lot easier and much chaos will
be avoided if you use the partial menu mechanism to allow users to
customize their own menus.
In our setup, the base menu is an unaltered,
out-of-the-box acad menu. And we use the Express Tools, which loads a partial
menu. And we have a company-standard custom partial menu, which includes
toolbars, pulldowns, etc. Its associated mnl file causes all of our custom lisps
to load.
Finally every user has a partial menu named
user.mns, with associated user.mnl, on their local machine, and they're entitled
to do anything they want to with that. It's initally empty, containing nothing
but an empty "user" toolbar. They're encouraged to add toolbars, and customize
them to their heart's content, but NOT to alter anything outside of the "user"
menu. That way, when I issue a revised company-standard menu (as I do
regularly), it won't affect anything the users have done.
If they want their own toolbar that has a
few buttons from an Acad toolbar, and some buttons from one of our
toolbars, they can drag copies of those buttons onto their own toolbar, then
turn off the other toolbars.
The point is, everyone has all the same stuff, PLUS
everyone can have his own personal stuff too. That's the best way to approach
any customization, when at all possible: make it an addition, on top of a
standard element, not an alteration of the standard element. We run a complete,
standard installation of Acad, and not one single file is altered in that.
All of our stuff is *in addition to* that, not a modification of it. Makes
maintenance a breeze.
Don't load an mnu!!
Loading an mnu file overwrites the associated mns
and mnc files. An mnu is called a menu "template" by Acad. It isn't used for
anything but creating an mns, if and when you force it to load. Acad itself
doesn't operate on anything but the mns. Think of the mnu as a backup file. When
you have an mns that works, copy it to an mnu for safekeeping. Acad will never
touch or alter the mnu unless you force it to. But everytime the user changes a
toolbar, for instance, the mns changes and the menu recompiles. The mnu will
never reflect any changes the user has made, only the mns will. If you reload
the mnu, you'll wipe out the user-customized mns and destroy everything they've
done.
The menuload command loads the mns file by default.
If you say (command "menuload" "user") with no extension, it loads user.mns. It
doesn't use, load, or access mnu files unless you specifically tell it to in the
dialog box, or unless you specify the mnu extension (command "menuload"
"user.mnu"). In which case it will overwrite the mns and recompile the
menu.
The Acad profile includes what menus to
load. In our case, the profile causes the Acad menu and three partial menus to
load. It isn't necessary for us to menuload anything, because each person has an
identically named (though different) user.mns on their local machine. The
company-standard profile causes it to load.
Unless your people move between machines, or you
have some other reason to put all menus in one central location, this would seem
like an easier approach than individually named menus. Its not clear what you're
trying to do in the fragment below ... presumably you've already set the
menuname variable before the cond. If so, why not just load it?? Or simply adopt
the convention that the menu name matches the loginname, so WPZ's menu is
wpz.mns. Then all you need to do is say (command "menuload" (getvar
"loginname")). No point in using a cond when the result of every test condition
is the same.
Again, look into the partial menu mechganism before
you go any farther into this project. Users will mess up their menus, and your
life will be easier if they only mess up their little partial menus instead of
your great big menu. And if you don't isolate their customizations in separate
partial menus, you'll never be able to maintain or revise a company-standard
menu.
Tom
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
I
am looking at setting up a new system with Acad 2k4.
If I want each user
to have his/her own menu, I was told to use the menuload command in the
acad.mnl file to load a copy of the acad.mnu with each user name. So if I use:
(cond (= (getvar "loginname") "WPZ")
(command "menuload"
menuname)
)
(= (getvar "loginname") "RDM")
(command "menuload"
menuname)
)
)
That should load each copy as named but my question is:
After the initial loading of each custom menu AutoCAD creates the .mns and
.mnc files for each menu and these are to my understanding what is used to
store further customization to toolbars ect. Does loading the .mnu file each
time acad is opened from the .mnl file overwrite the .mns and .mnc files that
are now different than the original custom.mnu? I don't think so but am
looking for further info on this subject before I actually do this project.
TIA
Bill