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

Toolbar customization

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
186 Views, 11 Replies

Toolbar customization

When creating a custom toolbar and designing new icons using AutoCAD's button image editing tools, how can I save this menu and the associated buttons to share with another user?
11 REPLIES 11
Message 2 of 12
BillZ
in reply to: Anonymous

The new tool bar should show up in your .mns file.
Cut and paste it into the other users .mns and.mnc files or delete the .mns and let the .mnc recompile.


Bill

Edit:
Sorry, I should have said...Paste into the .mns and delete the .mnc and recompile.
Message was edited by: BillZ
Message 3 of 12
hawstom
in reply to: Anonymous

The best way is to use Partial Menus. Put only your menu stuff into a small .MNU file, then use the menuload command to add it to the ACAD menus.

Then you can write a lisp routine that loads that menu using MENULOAD. Put that LISP routine in your autoload system.

I am attaching an example of a menu that defines function key osnaps. It includes a .MNU and a .LSP.

I am also attaching an example of a menu that loads the pulldown for my Construction Notes Manager. It includes a MNU, some bitmaps for the toolbar (which I am not including), an MNL to place the pulldown and load the lisp routines (which I am not including, but you can get them by searching Google), and a lisp routine to load the menu.

Tom Haws
Find me at Google
Message 4 of 12
hawstom
in reply to: Anonymous

Umm, I guess nobody likes to read attachments, so here is the code for a funky menu, as an example.

----FUNKY.MNU----
***MENUGROUP=FUNKY

***ACCELERATORS
[CONTROL+SHIFT+"Z"]'ZOOM W
[CONTROL+SHIFT+"X"]'ZOOM P
[CONTROL+SHIFT+"A"]'ZOOM A
["F3"]CEN
["F4"]ENDP
["F5"]INS
["F6"]INT
["F7"]MID
["F9"]NEAR
[SHIFT+"F9"](AH)
["F11"]NODE
[SHIFT+"F11"]QUAD
["F12"]PERP
[SHIFT+"F12"]TAN
------END FUNKY.MNU---------

------FUNKY.LSP------------
;The command FUNKY loads the FUNKY menu.
(defun c:funky () (command "menuunload" "funky" "menuload" "funky"))
-------END FUNKY.LSP------

Tom Haws
Find me at Google
Message 5 of 12
BillZ
in reply to: Anonymous

I think all's he wanted to do was copy a tool bar over to anothers menu.


Bill
Message 6 of 12
Anonymous
in reply to: Anonymous

I was editing a partial menu. As I was creating the buttons, I was adding the macros/lisps to each function. I could open and close AutoCAD and the menu would come back. But when I unloaded the menu, then reloaded it, the new toolbars are gone and no where to be found.
Message 7 of 12
BillZ
in reply to: Anonymous

When you loaded the menu, did you load the .mnu or the .mns?

If you want the changes in the .mns to be permanent then you have to copy the changes out to the .mnu otherwise if the .mnu gets loaded, it wipes out the .mns file.

HTH

Bill
Message 8 of 12
BillZ
in reply to: Anonymous

When you loaded the menu, did you load the .mnu or the .mns?

If you want the changes in the .mns to be permanent then you have to copy the changes out to the .mnu otherwise if the .mnu gets loaded, it wipes out the .mns file.

HTH
Message 9 of 12
Anonymous
in reply to: Anonymous

I loaded the .mnu file. I guess that's where I screwed up!
Message 10 of 12
Anonymous
in reply to: Anonymous

IMHO always check if it exists,first (defun c:funky () (if (menugroup "funky") (command "menuunload" "funky")) ;; then (command "menuload" "funky")) also it is a good idea to clear the registry of the toolbar positions so the ones defined in the mnU file will be applied... (setq rkey "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD\\R16.0\\") (if (vl-registry-descendents rkey) (progn (setq dkey (car (vl-registry-descendents rkey))) (vl-registry-delete (strcat rkey dkey "\\Profiles\\" (getvar "CPROFILE") "\\Toolbars")) )) mark "hawstom" wrote in message news:13049708.1077642640341.JavaMail.jive@jiveforum2.autodesk.com... > Umm, I guess nobody likes to read attachments, so here is the code for a funky menu, as an example. > > ----FUNKY.MNU---- > ***MENUGROUP=FUNKY > > ***TOOLBARS > > ***ACCELERATORS > [CONTROL+SHIFT+"Z"]'ZOOM W > [CONTROL+SHIFT+"X"]'ZOOM P > [CONTROL+SHIFT+"A"]'ZOOM A > ["F3"]CEN > ["F4"]ENDP > ["F5"]INS > ["F6"]INT > ["F7"]MID > ["F9"]NEAR > [SHIFT+"F9"](AH) > ["F11"]NODE > [SHIFT+"F11"]QUAD > ["F12"]PERP > [SHIFT+"F12"]TAN > ------END FUNKY.MNU--------- > > ------FUNKY.LSP------------ > ;The command FUNKY loads the FUNKY menu. > (defun c:funky () (command "menuunload" "funky" "menuload" "funky")) > -------END FUNKY.LSP------ > > Tom Haws > Find me at Google
Message 11 of 12
BillZ
in reply to: Anonymous

Sorry I didn't mention that.

I didn't think you would reload the .mnu because that will take out any cutomizations made from the interface. So I thought you would be working just with the .mns and if you weren't, then I just assumed that you would know about that already..

I guess that's how I found out about that too.

If you have a similar toolbar you can copy that and modify it.

Good luck

Bill
Message 12 of 12
hawstom
in reply to: Anonymous

Thanks for the tip, mark. It is more elegant than my method. My method required deleting the MNS, MNC, and MNR to get results. You don't need to check before unloading, but it is certainly more elegant.

It sounds like his problem may be that he needs to delete his MNR, MNC, and MNS files, and use a MNU for the source of his partial menu.

Tom Haws
Find me at Google

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

Post to forums  

Autodesk Design & Make Report

”Boost