[Click Here for Info on Placing Your Banner Ad Here]
CLICK ON THE IMAGE TO FIND OUT HOW TO PLACE YOUR AD WITH PAUG

IMAGE TILE MENUS - September 1999

By Chip Kanne.

An Image Tile Menu is a simple dialog box that you can populate with pictures, and when these pictures or images are selected, a command is activated. It is not that hard to create this type of menu, you don’t even have to know LISP. All you need to know is basic menu syntax and how to create a slide file.

To see an example of an image menu (R13, R14 and AutoCAD 2000) go to the Draw pull-down menu and select Surfaces & 3D Surfaces. There is also another one under the View pull-down menu: Tiled Viewports => Layout (R13 and R14 only).

 

3dobjects_tilemenu.jpg (30055 bytes)

 Images

The first step is to decide what images you want to display in your image tile menu. Either use your exciting symbol and or block library, or draw the symbols that you use repetitively. Then take a picture of them with the MSLIDE command.

The ratio of the image tile boxes (width to height) 1.5 to 1. To ensure that your pictures have the right ratio as the image displayed in the dialog box, make a 3 X 2 viewport in Paper Space.

  • R14 – Turn Tilemode off (TILEMODE=0), i.e. Paper Space
  • Using the MVIEW command, create a 3 X 2 viewport
  • Command: MVIEW [enter]

ON/OFF/Hideplot/Fit/2/3/4/Restore/<Frist Point>: (pick the lower left-hand corner of the screen), this point will always be 0,0

Other corner: @3,2

  • Zoom Extents
  • Switch back to Model Space
  • Use the Save As command and save the drawing as VP.dwg.

If you don’t already have a library of parts and or symbols, make them now and save them as a WBLOCK in a known sub-directory. You will later save the slide files in the same place.

Using the MSLIDE command, we’re going to create the slide file library in the same sub-directory as our wblocks, e.g. a-border.sld. A slide file is just a simple vector image; no properties are attached to this rather small file. If you’re in Model Space, MSLIDE takes a picture of the current viewport. If you’re in Paper Space, MSLIDE takes a picture of the current Paper Space display including all viewports. Objects that are off the screen are not included in the slide file. Keep in mind that image tiles show only the outline of filled objects such as donuts, wide polylines and solid fills.

Start a new drawing by opening the VP.dwg. Now using the DDINSERT command, insert your first WBLOCK. Use the Zoom Extents command, this will center and zoom the block, leaving a small space on the left and right sides of the drawing. Now use the MSLIDE command and make a slide file of your block, save the slide in the same sub-directory as your wblocks. You’ll repeat the exact same process for each of your objects. Quick repeat.

  • Draw the objects.
  • Draw the 3 X 2 viewport and save the drawing.
  • Start a new drawing and insert your VP drawing.
  • Insert your objects.
  • Make the slide files from you objects.

Now you’re ready to create your menu.

 

Creating the Menu

MAKE A COPY OF YOUR acad.mns FILE

The image menus belong in a section called ***IMAGE. Open up the acad.mns file, and

do a search until you find the ***IMAGE section. Within this section you will see several image menus. Each image menu is preceded with two asterisks and the word IMAGE. For example: **IMAGE_3DOBJECTS.

I’m going to call this menu **IMAGE_PAUG. I’ll put it right under the **IMAGE_3DOBJECTS section.

Take a look at the syntax.

***IMAGE
**IMAGE_3DOBJECTS
[3D Objects]
[acad(Box3d,Box3d)]^C^Cai_box
[acad(Pyramid,Pyramid)]^C^Cai_pyramid
[acad(Wedge,Wedge)]^C^Cai_wedge
[acad(Dome,Dome)]^C^Cai_dome
[acad(Sphere,Sphere)]^C^Cai_sphere
[acad(Cone,Cone)]^C^Cai_cone
[acad(Torus,Torus)]^C^Cai_torus
[acad(Dish,Dish)]^C^Cai_dish
[acad(Mesh,Mesh)]^C^Cai_mesh
**IMAGE_PAUG
[PAUG Symbols]
[a-border,A-Border]^C^Cinsert;C:/support/a-border
[b-border,B-Border]^C^Cinsert;C:/support/b-border
**IMAGE_POLY
[Set Spline Fit Variables]
[acad(pm-quad,Quadric Fit Mesh)]'_surftype 5
***IMAGE_PAUG, The name of our image menu. [PAUG Symbols] the title that displays at the top of our image menu.
[a-border,A-Border]^C^Cinsert;C:/support/a-border

This line needs to be broken into two sections for proper explanation. [a-border,A-Border] is the name of the slide file and the name that you want to displayed for the first box. This is case sensitive in that the case you use with-in the brackets will be the case displayed in the dialog box. ^C^Cinsert;C:/support/a-border is the menu code that inserts the block a-border into the drawing. ^C^C cancels out of the existing command, ; is enter and C:/support /a-border is the location of the block. Don’t use a \ (back slash) standard computer code, because in AutoCAD a back slash creates a pause for user input.

Suppose the name of the slide file and the text you want to display within the dialog box are not the same. This can be done by specifying the slide file name first, the text for the dialog box second and separating them with a comma, i.e. [csink,Counter Sink].

Notice that there are 20 image tile boxes within the dialog. If you created a menu with 25 objects, 20 would go on the first page and five on the second page. AutoCAD will create the second for you – complete with buttons that permit you to go forward and backward between the pages.

 

Getting to the Menu

You can only get to an Image Tile Menu through a menu; you can not use the command line. So now, we need a method of getting to your new Image Tile Menu. I suggest at the end of the Insert pulldown and at the bottom of the O-snap pop-up, with a three button mouse use the middle mouse button, with a two button mouse use, Shift + right mouse button.

Open your Explorer, now open your acad support folder, and open the acad.mns file. Do a search for ***POP4 (INSERT) menu. Add the following code to the end of this menu, [PAUG &Symbol Library…]$I=image_PAUG $i=*

***POP4
**INSERT
ID_MnInsert [&Insert]
ID_Ddinsert [&Block...]^C^C_ddinsert
[--]
ID_Xref [E&xternal Reference...]^C^C_xref
ID_Image [Raster &Image...]^C^C_image
[--]
ID_3dsin [&3D Studio...]^C^C_3dsin
ID_Acisin [&ACIS Solid...]^C^C_acisin
ID_Dxbin [Drawing &Exchange Binary...]^C^C_dxbin
ID_Wmfin [&Windows Metafile...]^C^C_wmfin
ID_Psin [Encapsulated &PostScript...]^C^C_psin
[--]
ID_Insertobj [&OLE Object...]^C^C_insertobj
[--]
[PAUG &Symbol Library…]$I=image_PAUG $I=*

If you would like to access your Image Tile Menu from anywhere within the drawing editor, I would suggest adding this same line of code to the bottom of the ***POP0 menu. Do a search for ***POP0 in the up direction.

The ampersand in front of the word Symbol denotes the mnemonic key.

$I=image_PAUG tells AutoCAD to display the image tile menu, without all these components, the image menu will not display.

Save this acad.mns file. Now start AutoCAD and add the sub-directory where your slide files and w-blocks are kept, to your Support File Search Path. Quick Repeat.

  • Preferences à the File tab
  • Open Support File Search Path
  • Click Add
  • Click Browse
  • Find the location of the slide files and wblocks and highlight it
  • Click Apply

You will get a message box that says, "This may not take effect until AutoCAD is restarted", so exit and restart.

CONCLUSION
You now have an easier way of inserting your commonly used symbols in a symbol library, instead always having to use DDINSERT.
If you have any questions about setting up one of these menus, feel free to give me a call at Home: (303) 989-4298
Work: (303) 761-7601 Ext. 3617

Send comments or questions about PAUG to mail05@paug.org.
Send comments or questions about this Web Site to webmaster05@paug.org.
Post AutoCAD questions at http://forum.paug.org/.
Revised: Wednesday, 30. November 2005.