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

Menu loading question.

8 REPLIES 8
Reply
Message 1 of 9
BillZ
239 Views, 8 Replies

Menu loading question.

R2004:
In my Acad.mnl file I have a line to check for a custom .mns file and if the file is found, I use the menuload command to load it using autolisp.
When I make changes to my .mns and delete the old .mnc and .mnr and start autocad, I can see when autocad starts that it is recompiling an .mnc and.mnr, but the changes to the .mns are not evident. I put some (princ "**Hello**") in my .mnl file, but I don't see the prompt on the sceen. It's seems as if my acad.mnl is being ignored.
This is the code I put in my acad.mnl:
(if (setq mnuloc (findfile (strcat "G:/autolisp/autocad_2004_support/" (getvar "loginname") "_acad.mns")))
(progn
(princ mnuloc)
(command ".menuunload" "acad")
(command ".menuload" mnuloc)
(princ (strcat "\nG:/autolisp/autocad_2004_support/" (getvar \"loginname\") "_acad.mns Loaded."))
)
)
My support paths are correct and there are no other matching files in any of the support paths.
If I manually load the .mns file after autocad is up, then I see the changes. Why?

Bill
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: BillZ

Bill,

I'll go out on a limb and give this one a try.

First off, if the .mnu file has been modified and you want it to update the mnc file, you don't have to delete the mnc file. Simply reloading the menu using the mnu file will recompile the mnc file.

If the menu you are trying to load is in the search path, try to load it just by calling the menu file name with the .mnu extension.

If that doesn't work, try moving the menuload functions to a S::STARTUP function.

I'm still scratching my head on this one but I hope this helps.

Tim Ulrich
CAD Manager
HOK Houston
Message 3 of 9
EC-CAD
in reply to: BillZ

Bill,
You may have to do a POP to get it to post.
(menucmd "P1=+ACAD.POP1")
..or such

Bob Shaw
Message 4 of 9
BillZ
in reply to: BillZ

Thanks.
Scratch that part about the .mnl being ignored.
I use a custom .mns file, not an .mnu.
When I load the custom .mns in my .mnl file (which btw is just a copy of the acad.mns that loads each time autocad is started up.
When the custom .mns is load via the .mnl, I don't see the changes made to it. When I use menuload at the command prompt, and load the custom .mns, then I see the changes but then my express tools toolbars will disappear and I have to reload them.
What gives?

Bill
Message 5 of 9
BillZ
in reply to: BillZ

Thanks,
I don't think so because my .mns is just a copy of the acad.mns the I have given a different group name to and load it after startup time in the .mnl file.
So it's my main menu file really.
Message 6 of 9
Anonymous
in reply to: BillZ

Personally, I would stay away from modifying or editing AutoCADs menus, and just create custom partial menus. Have a reactor or some lisp utility to check for that menu being loaded. My 2 cents. -- Rudy@Cadentity.com AUTODESK Authorized Developer www.Cadentity.com MASi "BillZ" wrote in message news:26154407.1071768704297.JavaMail.jive@jiveforum2.autodesk.com... > R2004: > In my Acad.mnl file I have a line to check for a custom .mns file and if the file is found, I use the menuload command to load it using autolisp. > When I make changes to my .mns and delete the old .mnc and .mnr and start autocad, I can see when autocad starts that it is recompiling an .mnc and.mnr, but the changes to the .mns are not evident. I put some (princ "**Hello**") in my .mnl file, but I don't see the prompt on the sceen. It's seems as if my acad.mnl is being ignored. > This is the code I put in my acad.mnl: > (if (setq mnuloc (findfile (strcat "G:/autolisp/autocad_2004_support/" (getvar "loginname") "_acad.mns"))) > (progn > (princ mnuloc) > (command ".menuunload" "acad") > (command ".menuload" mnuloc) > (princ (strcat "\nG:/autolisp/autocad_2004_support/" (getvar \"loginname\") "_acad.mns Loaded.")) > ) > ) > My support paths are correct and there are no other matching files in any of the support paths. > If I manually load the .mns file after autocad is up, then I see the changes. Why? > > Bill
Message 7 of 9
BillZ
in reply to: BillZ

Thanks Rudy,
What I ended up doing was (looking both ways for the flame),
I created a .mns file for each user. It's just a copy of the acad menu plus I added the custom toolbars from each users R14 menus.
That way I can check for the user .mns files at s::startup and use (command "menu" "user_menu.mns") to set each users session to their own menus.
This may sound like a mess to some but we have had many years of R14 and I think this will work for us.
Hopefully there will be no more overwriting of each users interface when one user logs on to anothers machine and starts creating custom buttons and such. That's been the only complaint with our system over the years.
Also we plan to instruct them not to alter the standard toolbars and create new ones if needed.

If someone can see a real big problem with this other than if new menus come out and need to be updated, I'd like to hear about it.

Thanks all for the help.
Bill
Message 8 of 9
Anonymous
in reply to: BillZ

If I understand that all you want to do is (princ "**Hello**") then all you need is an acad.lsp, such as: (DEFUN S::STARTUP () (COMMAND "STYLE" "STANDARD" "arial.ttf" "" "" "" "" "") (SETVAR "AUPREC" 2) (SETVAR "BLIPMODE" 0) (SETVAR "CMDECHO" 0) (COMMAND "SETVAR" "COORDS" 0) (COMMAND "SETVAR" "DIMCLRT" 0) (SETVAR "DIMEXE" 0.09) (COMMAND "SETVAR" "DISPSILH" 1) (SETVAR "DIMTAD" 1) (SETVAR "DIMTIH" 1) (SETVAR "DIMTXSTY" "STANDARD") (SETVAR "DIMTXT" 0.125) (SETVAR "DIMCEN" 0.09) (SETVAR "DIMUNIT" 6) (SETVAR "DIMDEC" 5) (SETVAR "DIMAUNIT" 0) (SETVAR "LUNITS" 4) (COMMAND "UNITS" 4 32 1 2 0 "N") (SETVAR "DIMUPT" 0) (COMMAND "SETVAR" "DIMZIN" 7) (COMMAND "SETVAR" "EDGEMODE" 1) (SETVAR "FILEDIA" 1) (COMMAND "SETVAR" "FONTALT" "ROMANS") (SETVAR "FACETRES" 10) (SETVAR "ISAVEPERCENT" 0) (SETVAR "MIRRTEXT" 0) (COMMAND "SETVAR" "OSMODE" 32) (COMMAND "SETVAR" "LTSCALE" (/ (GETVAR "DIMSCALE") 2)) (COMMAND "SETVAR" "SAVETIME" 10) (SETVAR "SORTENTS" 23) (SETVAR "TEXTQLTY" 25) (COMMAND "SETVAR" "TEXTSTYLE" "STANDARD") (COMMAND "SETVAR" "TEXTSIZE" 0.125) (SETVAR "UCSICON" 1) (COMMAND "VIEWRES" "" 1000) (if (not (tblsearch "layer" "1")) (command "layer" "M" "1" "c" "red" "1" "L" "continuous" "1" "")) (if (not (tblsearch "layer" "2")) (command "layer" "M" "2" "c" "yellow" "2" "L" "continuous" "2" "")) (if (not (tblsearch "layer" "3")) (command "layer" "M" "3" "c" "green" "3" "L" "continuous" "3" "")) (if (not (tblsearch "layer" "4")) (command "layer" "M" "4" "c" "cyan" "4" "L" "hidden" "4" "")) (if (not (tblsearch "layer" "5")) (command "layer" "M" "5" "c" "RED" "5" "L" "center" "5" "")) (command "SETVAR" "CLAYER" "0") ) ; (VMON) (prompt "\n****Hello****") (prompt "\nLoading Acad.lsp...Please wait.....")
Message 9 of 9
BillZ
in reply to: BillZ

(VMON) Egads man! Is that even a function anymore? :0)

I do have a acad.lsp with an s::startup that take care of what we do.
I described what I did in my reply to Rudy.

Thanks

Bill

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

Post to forums  

Autodesk Design & Make Report

”Boost