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

Customized menus.

27 REPLIES 27
Reply
Message 1 of 28
BillZ
218 Views, 27 Replies

Customized menus.

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
27 REPLIES 27
Message 2 of 28
SMMASON
in reply to: BillZ

I have always found that when loading a .mnu file, it creates new .mns and .mnc files. When you customize a toolbar for that menu file, the changes are made in the .mns file and not the .mnu file. So, if you load the .mnu file, any changes made by the user to his/her own menu will be lost. I suggest loading the .mns file.
Message 3 of 28
old-cadaver
in reply to: BillZ

If the MNU/MNS is unchanged, the MENULOAD command will not re-compile the menu.
Message 4 of 28
SMMASON
in reply to: BillZ

In addition, I make backup files for both the users menu and Autocad menu. From experiance, I have a user that likes to modify toolbars alot. Eventually, the users messes something up and would like to get it back to where it was.
Message 5 of 28
BillZ
in reply to: BillZ

>>>>>>If the MNU/MNS is unchanged, the MENULOAD command will not re-compile the menu.<<<<<<<<<

By "unchanged" do you mean if they exist already or something else?

Bill
Message 6 of 28
BillZ
in reply to: BillZ

>>>Eventually, the users messes something up and would like to get it back to where it was.<<<


Been there. 🙂


Bill
Message 7 of 28
Anonymous
in reply to: BillZ

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

Message 8 of 28
Anonymous
in reply to: BillZ

Here's what I've done to do the same, but I don't have to worry about
having different named files lying around.

(we use acad mechanical and have 3 menus loaded just from that)

--AutoCAD's standard menus are loaded and unchanged.
--Our company's standard partial menu is loaded from the network
--a "Personal.mns" is loaded from each workstation locally. This is
where the users have been instructed to save their toolbars and such

(to combat them accidentally saving the toolbars in AutoCAD's menus I've
actually put them on the network and have them loaded from there and
removed them from the local workstation).

All of those settings are saved in a profile .arg file and loaded and
setup the first time I install acad on a system.

I've been doing it like this for over 1-1/2 years and haven't had
anything blow up on me yet. It also makes upgrades a million times
easier becuase if Autodesk changes the menus that come with acad we get
those, our company standard menu is there and every gets updates right
after they're made (next time they open acad or run our command to
reload that menu) and the user's toolbars are saved in a safe, separate
location to just load in the next version of acad.

HTH
Kevin


On 7/9/2003 5:00 AM BillZ spoke thusly:


> 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)
> )
> )
Message 9 of 28
Anonymous
in reply to: BillZ

Forcing a menuunload/menuload, and specifying the
mnu extension in the menuload, always overwrites the mns and makes the menu
recompile, regardless of whether the existing mnu and mns are already identical.
Try it. It's a harmless, meaningless recompilation, but it happens.

 

Menuload never loads an mnu unless you force it to.
If you leave off the extension, it loads the mns.

 

Menuloading the mns will not force a recompilation
unless the mns has a later date than the mnc. Recompilation happens
automatically when Acad opens, any time this is true. Date on the mnu is
irrelevant since Acad doesn't use the mnu for anything, unless you force it to
overwrite an mns.

 


Anything the user does to alter a toolbar will
change the mns, which will recompile the mnc/mnr on the spot. That's the only
thing they're likely to do, but if they manually edited the mns, that
would do the same effect. Anything that changes the file date of the mns to
be more recent than the mnc will trigger recompilation next time Acad
loads.

 

 



style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
>>>>>If the MNU/MNS is unchanged, the
MENULOAD command will not re-compile the
menu.<<<<<<<<<

By "unchanged" do you mean if they exist already or something else?

Bill

Message 10 of 28
Anonymous
in reply to: BillZ

Great minds 🙂 I was pounding out nearly identical advice at the same time.
I also manage the partial menu loading by including it in a standard arg
file.


Kevin Nehls wrote in message
news:B2653139ACBF2545C15EFE38B1F2B158@in.WebX.maYIadrTaRb...
> Here's what I've done to do the same, but I don't have to worry about
> having different named files lying around.
>
> (we use acad mechanical and have 3 menus loaded just from that)
>
> --AutoCAD's standard menus are loaded and unchanged.
> --Our company's standard partial menu is loaded from the network
> --a "Personal.mns" is loaded from each workstation locally. This is
> where the users have been instructed to save their toolbars and such
>
> (to combat them accidentally saving the toolbars in AutoCAD's menus I've
> actually put them on the network and have them loaded from there and
> removed them from the local workstation).
>
> All of those settings are saved in a profile .arg file and loaded and
> setup the first time I install acad on a system.
>
> I've been doing it like this for over 1-1/2 years and haven't had
> anything blow up on me yet. It also makes upgrades a million times
> easier becuase if Autodesk changes the menus that come with acad we get
> those, our company standard menu is there and every gets updates right
> after they're made (next time they open acad or run our command to
> reload that menu) and the user's toolbars are saved in a safe, separate
> location to just load in the next version of acad.
>
> HTH
> Kevin
>
>
> On 7/9/2003 5:00 AM BillZ spoke thusly:
>
>
> > 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)
> > )
> > )
>
Message 11 of 28
Anonymous
in reply to: BillZ

Ah, but you beat me by a couple minutes 😉

--
Kevin Nehls


"Tom Smith" wrote in message
news:5FA35D9AC837A7B5459AA8BAF845ECB2@in.WebX.maYIadrTaRb...
> Great minds 🙂 I was pounding out nearly identical advice at the same
time.
> I also manage the partial menu loading by including it in a standard arg
> file.
>
Message 12 of 28
BillZ
in reply to: BillZ

Thanks,
And I think I am understanding more about this.
I would however like the users here to be able to change anything they want as far as toolbars and what order the buttons are in or whatever from the interface and not have it change any of these things in any other users setup. I would think this would involve a separate menu for each user and a check of some kind in the acad.mnl to load each users menu by loginname. Initially the .mnu's would be basically copies of the acad standard. Is this possible?
I know you can tell them to not change certain things but hey, let's be real, with new users coming in you can't catch everything that they might do. I would rather make it so that each user can do basically anything they want to their own set up without it affecting anybody elses.

Bill
Message 13 of 28
Anonymous
in reply to: BillZ

IMO, you really don't want them editing even a copy of the acad.mnu. Trust
me, I've been there. They customize that, then you upgrade acad and acad's
menus have changed, but your custom menus don't have those new updates and
changes. So now you've either got to start your customizations all over
again or figure out a way to add all of the new/changed/fixed stuff from the
new acad menus to your custom menus. Not fun or easy either way.

Take a look at my other post about using a "person" partial menu, they can
then create their own pull-downs, toolbars, right-click menus, etc and swap
them out for the ones being loaded with acad's menus if they want.

--
Kevin Nehls


"BillZ" wrote in message
news:f175a02.10@WebX.maYIadrTaRb...
> Thanks,
> And I think I am understanding more about this.
> I would however like the users here to be able to change anything they
want as far as toolbars and what order the buttons are in or whatever from
the interface and not have it change any of these things in any other users
setup. I would think this would involve a separate menu for each user and a
check of some kind in the acad.mnl to load each users menu by loginname.
Initially the .mnu's would be basically copies of the acad standard. Is this
possible?
> I know you can tell them to not change certain things but hey, let's be
real, with new users coming in you can't catch everything that they might
do. I would rather make it so that each user can do basically anything they
want to their own set up without it affecting anybody elses.
> Bill
>
Message 14 of 28
BillZ
in reply to: BillZ

Kevin,
I don't that I would let them modify acad.mnu or a copy.
But if they create a toolbar or rearrange the buttons on a toolbar from the acad interface, what keeps track of those types of changes? Sure you can load a partial menu for osnaps and whatever but what about changes to the regular interface of each user? Some like to rearrange tool bars, create new tool bars and use their own icons that they create in the icon editor. What I want to do is start each one with the standard menu but as they make modifications from the graphical interface of acad, these changes are then kept and brought up each time they start autocad only on their machines. We have a diverse group of users as far as their JD's are concerned and they each use different commands and lisps that are loaded onto toolbar buttons as they see fit for their best performance. They are the experts at what they do and I'm just trying to figure out a way to make it work on our new system. Right now there are full menus loaded on each machine and if two people use the same machines and one makes changes to toolbars, it changes up the one on day shift. I don't care what changes they make from the interface. I just want to know how to kept each ones changes unique to their profile and loginname.


Bill
Message 15 of 28
Anonymous
in reply to: BillZ

If they rearrange or change the toolbars and buttons on the toolbars that
are loaded from the acad.mns file then those changes are stored in that
file. That's why I've put our acad menus on the network in a read-only
directory and put a "personal.mns" locally that they can change. This means
they can't change the toolbars or buttons that come with acad, but they can
create their own and store them in the "personal.mns" file.

The location of the toolbars is stored in the registry and their profile.

Oh, I see you have more than 1 person using the same machine. You could get
around this with roaming profiles or if you're not the network guy, but just
the acad guy, then I'd probably implement the same sort of thing you want to
my having a menu named after their loginname so that gets loaded. Or even
going as for as them having their own support path on the network named
after their loginname and having our company standard, network based
acaddoc.lsp loading that as a support path and then loading their menus and
settings, profile, etc.

--
Kevin Nehls


"BillZ" wrote in message
news:f175a02.12@WebX.maYIadrTaRb...
> Kevin,
> I don't that I would let them modify acad.mnu or a copy.
> But if they create a toolbar or rearrange the buttons on a toolbar from
the acad interface, what keeps track of those types of changes? Sure you can
load a partial menu for osnaps and whatever but what about changes to the
regular interface of each user? Some like to rearrange tool bars, create new
tool bars and use their own icons that they create in the icon editor. What
I want to do is start each one with the standard menu but as they make
modifications from the graphical interface of acad, these changes are then
kept and brought up each time they start autocad only on their machines. We
have a diverse group of users as far as their JD's are concerned and they
each use different commands and lisps that are loaded onto toolbar buttons
as they see fit for their best performance. They are the experts at what
they do and I'm just trying to figure out a way to make it work on our new
system. Right now there are full menus loaded on each machine and if two
people use the same machines and one makes changes to toolbars, it changes
up the one on day shift. I don't care what changes they make from the
interface. I just want to know how to kept each ones changes unique to their
profile and loginname.
>
> Bill
>
Message 16 of 28
BillZ
in reply to: BillZ

>>> then I'd probably implement the same sort of thing you want to
my having a menu named after their loginname so that gets loaded <<<<

That was the whole idea with my question.
If I initially make copies of acad.mnu and load them initially as "WPZ" or "RDM" with the acad.mnl to create the user.mns files, will the menuload command overwrite the user.mns files? What I don't know is do I use (command "menuload" "WPZ.MNU") or will(command "menuload" "WPZ") in the acad.mnl file to initially load the personalized menus?

Thanks

Bill
Message 17 of 28
Anonymous
in reply to: BillZ

Yeah, but my "user" menus seem so impersonal compared to your "personal"
ones.

Kevin Nehls wrote in message
news:A7822D40EC017A85BD8D7D850926E125@in.WebX.maYIadrTaRb...
> Ah, but you beat me by a couple minutes 😉
>
> --
> Kevin Nehls
>
>
> "Tom Smith" wrote in message
> news:5FA35D9AC837A7B5459AA8BAF845ECB2@in.WebX.maYIadrTaRb...
> > Great minds 🙂 I was pounding out nearly identical advice at the same
> time.
> > I also manage the partial menu loading by including it in a standard arg
> > file.
> >
>
>
Message 18 of 28
BillZ
in reply to: BillZ

I got it!
In the Acad.mnl
(command "menuload" (getvar "loginname"))

This should work wheather the user.mnu has already created the .mns files or not and is a lot less code.

You guys get me thinking , which can at times be benificial. {:^)

Bill
Message 19 of 28
Anonymous
in reply to: BillZ

I use (command "menuload" "menuname.mns"). Using .mnu will overwrite the
.mns files everytime, thus erasing their toolbar mods.

--
Kevin Nehls


"BillZ" wrote in message
news:f175a02.14@WebX.maYIadrTaRb...
> >> then I'd probably implement the same sort of thing you want to my
having a menu named after their loginname so that gets loaded <<<<
>
> That was the whole idea with my question.
> If I initially make copies of acad.mnu and load them initially as "WPZ" or
"RDM" with the acad.mnl to create the user.mns files, will the menuload
command overwrite the user.mns files? What I don't know is do I use (command
"menuload" "WPZ.MNU") or will(command "menuload" "WPZ") in the acad.mnl file
to initially load the personalized menus?
>
> Thanks
>
> Bill
>
Message 20 of 28
BillZ
in reply to: BillZ

What if the .mns does not exist yet?

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

Post to forums  

”Boost