home - about - advertise     

AutoCAD Tutorial

AutoCAD 2004 Customization Tutorial: Raster Images Slide Shows

By Alireza Parsai, June 9, 2003

Raster images are created based on pixels rather than Geometrical objects. Windows Paint and Photoshop are two famous applications that create Raster images. Some famous Raster formats are BMP, JPEG, TIFF, TGA, PNG, PCX, and GIF. AutoCAD RENDER command is also capable to create Raster images based on 3D models.

To view raster images in slide shows you should use the following AutoLISP statement in your script file:

(c:replay filename type [<xoff> <yoff> <xsize> <ysize>])

filename: The name of the Raster image file.
type: The type of the Raster image file (e.g. "BMP", "GIF", etc.)
[<xoff> ]: The location and size of the image in pixels. This section is optional.

The following tutorial shows you how to create Raster images with RENDER command and then build a slide show.

If you are not familiar with AutoCAD slides and/or scripts read any of the the relevant tutorial listed below before proceeding:

1. Download the following AutoCAD 2004 drawings:




If you are using an earlier version of AutoCAD, download the following files:




2. Open r16_3d_house.dwg in AutoCAD [Figure 1].

Figure 1 - Click on image to enlarge

3. Invoke RENDER command. A rendered image of the house appears in drawing environment [Figure 2].

Figure 2 - Click on image to enlarge

4. Invoke SAVEIMG command. The Save Image dialog box appears [Figure 3].

Figure 3

5. Write down the values for X-offset, Y-offset, X-size, and Y-size. The values that you get may be different with what you see in figure 3. The size of the image depends on the resolution of your screen and settings of AutoCAD window.

6. Click OK. The Image File dialog box appears [Figure 4].

Figure 4 - Click on image to enlarge

7. Save the file as "r16_3d_house.bmp" in AutoCAD search path.

Note: If you are not familiar with AutoCAD Search Path please read the following tutorial:

8. Repeat the steps 2 to 7 for "r16_3d_part.dwg" and "r16_3d_plate.dwg". Now the following Raster images are created:

► r16_3d_house.bmp

► r16_3d_part.bmp

► r16_3d_plate.bmp

9. In command line type Notepad and then press Enter twice. The Notepad window appears.

10. In Notepad window enter the text shown in Figure 5.

Figure 5

11. Save the file as "raster.scr" in AutoCAD search path.

12. Start a new drawing.

13. In command line type SCR. The Select Script File dialog box appears [Figure 6].

Figure 6 - Click on image to enlarge

14. Locate and open "raster.scr". The slide show begins. Figure 7 shows one sample image.

Figure 7- Click on image to enlarge

15. Press Esc to end the show.

16. Invoke REGEN to remove the image from screen.

Note: You may mix raster images with AutoCAD slides in a slide show. Figure 8 shows a sample script file.

Figure 8

About the Author

Alireza Parsai is the founder of cadpanel.com. He is a mechanical engineer with more than 12 years experience with AutoCAD. Alireza is an Autodesk Authorized Author, the AutoCAD consultant for Al Khawarizmi Institute, a contributing editor for Augiworld magazine, a writer for CAD Digest, an instructor for AUGI Training Program, and an elected speaker for Autodesk University 2002. He has written 7 books in Farsi, 3 booklets in English, and more than 30 articles for different magazines and newsletters. You can reach him at alireza.parsai@cadpanel.com or visit his website www.cadpanel.com

More CAD Corner tutorials >>

CADdigest Weekly
Email (required) *

A week's worth of articles will be emailed to you. See latest issue .