PDA

View Full Version : loading menus by toolbutton



gcp310
11th Apr 2003, 02:23 am
Does anyone know if its possible to load a custom menu by using a tool buttom?
i am interested in the code behind it if you can do such a thing.

Fuccaro, your the guru in the way of code, maybe you know of a way?

Thanks in advanced

G

fuccaro
12th Apr 2003, 10:02 am
Ok, G! Here I am. But I know just a few lisp and fewer about menus, so I am not sure I can help you. But let’s try! Please return with more details about what do you wish to do.
Do you all ready have a menu file MY_MENU.MNS? Or maybe it is a compiled file *.MNC?
Is it a toolbar menu?
Do you wish to load your menu by pressing a button placed on a toolbar?
Please send me as more details as it is possible, maybe the job will be to hard for me and you will get nothing from me. TheWorld is big, sure somebody else will read your post and will guide you in the right direction.
Miklos

gcp310
12th Apr 2003, 01:23 pm
ok, here we go...

say i wanted to creqate a cd with a whole file structure of blocks. and that i will also have a pulldown menu located on this cd. the idea is that for everyday use i have a toolbutton in autocad that i hit and the menu located on the cd would load, thus enabling me to drop blocks into cad.
then say, i get sent to another branch i can take the cd with me, or even take the cd home and work from home without too much problems, all referencing blocks from the cd.

Tell me if im nuts,or if the idea sounds possible.

Thanks

G

fuccaro
15th Apr 2003, 07:55 am
Hay G!
Do you wish to use a menu just for insert blocks in your drawing? The Insert block command will work even if the block is placed on a CD.
When the laser was discovered somebody wrote that “it is a solution seeking for a problem”. Today it is a solution to almost all problems.
It is possible to have a menu for inserting blocks, but what will be the advantage? –other than people remarks that you work with your own menus. Please help me to see the problem.
However I can write you how to create a pull-down menu containing commands to meet your needs. As I wrote in my previous message I am not an expert is this things; probable I will drive you on an other way but the simplest one –letting other readers to smile on my ignorance.
If you still want to start on this way, please write me the structure you desire to the new pull-down menu. I suggest you we work in more little steps and receive your feed back after every major step, rather than I send you a long text from first. Just in case, please have the AutoCAD install kit prepared.

gcp310
15th Apr 2003, 12:31 pm
I could probably set up the blocks on the cd to use the Design Window in autocad. and yes, i could just insert blocks using the insert command.

The bigger picture here is that i also have custom menus that seem to disappear everytime i close autocad and i have to menuload>setup the menus each time i open autocad. i have tried every trick in the book from file search paths to profiles.

Thanks for your interest in the matter. But you are Right. no need to make things totally complecated, just to do a simple task.

G

fuccaro
15th Apr 2003, 01:57 pm
i also have custom menus that seem to disappear everytime i close autocad and i have to menuload>setup the menus each time i open autocad. i have tried every trick in the book from file search paths to profiles.
Just for my curiosity: did you try to save your user profile?
Or let me recommend you an other solution: a small lisp routine set up to run at the start of the AutoCAD will load your custom menu file. But this only in extremis, if other solutions will fail.
Take care, G!

gcp310
16th Apr 2003, 08:22 am
Yes, i have tried saving my user profile. But no luck.

Have no where else to turn as far as loading menus.
What did you have in mind?

Thanks

G

Mr T
16th Apr 2003, 09:09 am
Yes, i have tried saving my user profile. But no luck.

Have no where else to turn as far as loading menus.
What did you have in mind?

Thanks

G

In my classroom I have 12 pcs which all load the same menus, every time a kid logs on.

Steps to do this

1) Setup whatever menus you like

2) Save that current profile - make a backup as well

3) Hunt in your Acad folder on the current machine for these files

It's the *.mnu and *.mnr files that acad loads up. Also in OPTIONS there are settings to tweak which will load certain files into menus.

Nick

fuccaro
16th Apr 2003, 09:14 am
G
I agree with Mr T. Let's try every solution to make the job in the "normal" way. What is the extension of your truble making menu file? Is it compiled *.mnc ?

gcp310
16th Apr 2003, 12:52 pm
Ok, i have three menus, all have their own folder in the autocad directory.
the menu folders file path have been added to the search file path under tool>options>files. I then load these menus using menuload. i load the .mnu files.

Then i go tools>profiles and save the profile, even export it out.

Then when i open autocad, Wala, no menus.
Before i load the menus i have tried deleting the .mnc & .mnr files so that new files are compiled and there is no chance of referencing the previous compiled menus.

Its frustrating, to say the least. i could copy all three menus into a copy of the autocad.mnu, but i shouldnt have to. the system by right, should load and keep loaded my three menus.

Thanks guys for your help. I shall however give it one more go tommorow.acutally, next week as im still at a 3 day viz course (talk about that another time)

G

Mr T
16th Apr 2003, 07:55 pm
You should not have to use menu load. If the file destination is correct then it should load when that particular PROFILE loads. Have you definitely loaded the right PROFILE ?

Also check that you have read and write privileges on the drive where acad is stored.

type MENU and see where acad looks for the menu files. It should be the CURRENT profile's 'support file destination' setting.

Get back to us. I'm away thurs nite till mon nite. But post back if req'd.

:lol:
Nick

Flores
17th Apr 2003, 01:47 am
This is a little lengthy, so I hope it is appreciated.
1: Make a menu called "mymenu.mnu" (or whatever name).
2: Use "menuload" to load it.
3: From the "menu groups" tab, locate and load it.
4: From the "menu bar" tab, using the "menu group"
drop-down, find "mymenu".
5: On the right hand side of that tab, choose "help",
then hit the insert button. (This put your menu in front of the
"help" menu)
6: Make sure the CD drive is in your "Support File Search Path".
Go to: tools>options>file tab "Add button", then "Browse",
browse to your CD (or whatever location).
The rest should be downhill. Make sure your menu is in the
support. I make a seperate folder outside of the ACAD folder
with all custom lisps, menus, profiles, plot styles, etc.
If you put this folder in the ACAD folder, and ACAD needs to be
uninstalled for whatever reason, you just lost all your custom stuff.

Use the below menu code to set you on your way, modification
should be self explanatory. By the way, if you modify "mymenu.mnu"
after it has been loaded, you will have to unload it with "menuload",
then reload it for your updates to take effect.



***MENUGROUP=Mymenu

***POP11
P1-1[Mymenu]
P1-2[Insert Wall]-insert Wall //menu item
P1-3[--] //divider
P1-4[Insert Lamp]-insert lamp //menu item
P1-5[--] //divider
P1-6[->Insert Submenus] //submenu main flyout
P1-7[->Windows] //submenu flyout 1 label
P1-8[standard window]-insert s_window //submenu flyout 1a
P1-9[Arched Window]-insert a_window //submenu flyout 1b
P1-10&#91;<-Bay Window&#93;-insert b_window //submenu flyout 1c and submenu terminator
P1-11&#91;->Doors&#93; //submenu flyout 2 label
P1-12&#91;24 x 81&#93;-insert 24_81 //submenu flyout 2a
P1-13&#91;31 x 81&#93;-insert 31_81 //submenu flyout 2b
P1-14&#91;<-<-36 x 81&#93;-insert 36_81 //submenu flyout 2c and submenu terminator



If you have any problems, please ask.
Flores

gcp310
18th Apr 2003, 01:31 am
Thanks to all for your imput, i shall give them a go next week after easter.

Till then

G

fuccaro
25th Apr 2003, 06:02 am
Are you ready to fight against the menus?
I have for you some suggestions. Have you time to experiment? If so, please check the directory containing your MENU.MNU file (let’s say the filename is MENU). If you will find a file MENU.MNC just load it next time with MENULOAD. You know the rest: save profile...set current...let me know...
Cheers!

gcp310
25th Apr 2003, 08:23 am
I shall give it a go.

Thanks