AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Page I. Page II Home. Page IV.

Creating Menu's - Page III.

Before loading the following menu, you should really un-load any of the test menu's that you still have loaded. If you don't, you just might run out of space on your menu bar.

OK, I see you're back. Now load the following menu file : 


P1-1[&Test Menu 3]
P1-2[&Layer 2 On]^C^CLayer;M;2;;			//menu item
P1-3[--]						//divider
P1-4[&Ortho On/Off]^C^C^O				//menu item
P1-5[--]						//divider
P1-6[->&Change]						//submenu label
P1-7[->C&hange Layer]					//submenu label
P1-8[Change to Layer 1]^C^CChange;\;P;LA;1;;		//submenu items
P1-9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1-10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1-11[<-Change to Layer 4]^C^CChange;\;P;LA;4;;		//submenu terminator
P1-12[->Ch&ange Colour]					//submenu label
P1-13[Change to Colour 3]^C^CChange;\;P;C;1;;		//submenu items
P1-14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1-15[Change to Colour 3]^C^CChange;\;P;C;3;;	
P1-16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;;	//submenu terminator
P1-17[--]						//divider
P1-18[&Kenny](alert "Kenny is Handsome")		//menu item

Your menu, hopefully, should look like this :



Right, enough of pull-downs for the meantime. Let's now have a look at Image Menu's.

Firstly, we need to create a couple of slides to display in our image menu.
Let's create some slides named D1 to D8, DDOOR and HDDOOR.
You can create these slides yourself using any object that you wish, as long as they are named as stated. (I need the server space and drawing files are rather big.) Now we need to create a file library as a container for these slides.

Locate the Slidelib.exe function. It is normally in your Acad Support directory. Copy it to the same directory as your slides.
Now create a text file named Slidelist.LST and in it, make a list of all the slide names. (Remember to check spelling and case.)


Make sure that this file is also in the same directory as the slides.
Now go to DOS. (Remember that 'black' place?)
At the DOS prompt find your way to the directory where your slides, Slidelib.exe and Slidelist.LST are located.
Type : 

slidelib DOORS < Slidelist.LST then ENTER.
If you have done everything correct, DOORS.SLB should be created.
Next, we need to add an Image section to our menu file : 

P1_1[&Test Menu 4]
P1_2[&Layer 2 On]^C^CLayer;M;2;;
P1_4[&Ortho On/Off]^C^C^O
P1_7[->C&hange Layer]
P1_8[Change to Layer 1]^C^CChange;\;P;LA;1;;
P1_9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1_10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1_11[<-Change to Layer 4]^C^CChange;\;P;LA;4;;
P1_12[->Ch&ange Colour]
P1_13[Change to Colour 3]^C^CChange;\;P;C;1;;
P1_14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1_15[Change to Colour 3]^C^CChange;\;P;C;3;;
P1_16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;;
P1_18[&Kenny](alert "Kenny is Handsome")
P1_20[Image Menu]^C^C$I=TEST4.DOORS $I=*		//calls Image Menu

[DOORS Created by Kenny Ramage ]

The first line, ***IMAGE, defines the Image section of the menu.
The second line, **DOORS, is the name of the Image section submenu.
The third line is the title of the label that appears at the top.
The following lines get a bit more complicated so, let's dissect them.


[DOORS is the name of the slide library.
(D1, is the name of the specific slide.
,DOOR1)] is the label that is displayed in the list box.
INSERT;*D1;\;; is the menu macro.

Your Pull Down menu should now look like this :


And your Image menu like this (with different images of course) :


Did you notice the method of calling the image menu?

P1_20[Image Menu]^C^C$I=TEST4.DOORS $I=*

Good, at least some one is awake ;-)
Phew...(Wipe's sweat off brow)....Time for a break.
Next we'll move on to Custom Toolbars.

See you on the next page......

Page I. Page II. Home. Page IV.
The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website