AutoCAD® slide files and AutoCAD® slide libraries you may use for several purposes, e.g. for making slide shows with AutoCAD®, file exchange in your own applications or for using the preview function in AutoCAD® dialogs (such as the hatch pattern selection dialog in AutoCAD® applications older than AutoCAD® 2000). For slide files you only need AutoCAD®'s onboard tools and commands.
Creating slide files is very easy. Enter the MSLIDE
command at the AutoCAD® command prompt. Before using this command zoom in the window which you want to export into the slide file! To read slide files, use the VSLIDE
command. To integrate your slide files into a AutoCAD® slide library you should read this chapter.
To implement slide file support to you own applications you'll need the file format description below or find it at Wotsit's format - the programmers resource.
There are 2 different file headers:
AutoCAD® uses the old header
up to AutoCAD® Release 8.
AutoCAD® Release 9 and later produce slide files with the new header
.
Slide files always consist of a header (new header: 31 bytes, old header: 34 bytes) and one or more data records.
All coordinates and sizes written to the slide file reflect the graphics area of the display device from which the slide was created, with point [0,0] located at the lower left corner of the graphics area.
Firstly, this is the new file header:
If you're using AutoCAD® Release 9 or later, it'll produce the header described above and is portable among all computers with AutoCAD Release 9 or later. The old slide header described below (produced with previous versions of AutoCAD®, as well as AutoShade 1.0 and AutoSketch 1.02) looks a bit different:
And secondly, the old file header:
Difference between old and new file header:
The old format header doesn't contain a test number field. The floating-point aspect ratio value and all 2-byte integers are written in the native format of the CPU that was used to create the file (for 8086-family CPUs, IEEE double-precision, and low-order byte first). Old format slide files are not portable across machine types, but they can be read by any version of AutoCAD running on the same CPU type as the CPU with which the slide was created.
The header is followed by data records. Each data record begins with a 2-byte field whose high-order byte is the record type. Don't forget the byte order (also known as endianess) determined in the test number
field in the file header!
Here is a list of all known slide file data records:
If a slide contains any vectors at all, a new color record will be the first data record. The order of the vectors in a slide, and the order of the endpoints of those vectors, may vary.
For example, the following is an annotated hex dump of a simple slide file created on an IBM PC/AT with an IBM Enhanced Graphics Adapter. The slide consists of a white diagonal line from the lower-left corner to the upper-right corner of the graphics area, a green vertical line near the lower-left corner, and a small red rectangle at the lower-left corner.
If you show the slide file from above in AutoCAD® using the
VSLIDE
command it will look like the screenshot on the left.