Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Autocad 2005 And Autocad LT 2005 Bible (2004).pdf
Скачиваний:
92
Добавлен:
17.08.2013
Размер:
32.22 Mб
Скачать

Chapter 30 Creating Macros and Slide Shows with Script Files

915

Creating Slide Shows

 

One use for script files is to create a slide show. You can save a view of a drawing as a slide.

 

You can then create a slide library from the slides and show the slides one after another

 

automatically.

Tip

You can save any drawing as an image file and import it into a presentation program that

 

creates slide shows, such as Microsoft PowerPoint, Lotus Freelance Graphics, or Corel

 

Presentations. You can add text, special effects, and more to create a professional slide show.

 

For more information, see Chapter 27.

Creating slides

Creating a slide is like capturing the screen of your drawing. AutoCAD or AutoCAD LT makes a simplified vector file from the current viewport in model space, or from all viewports in paper space layouts. You can also create a slide of a wireframe, or hidden display. Unfortunately, you cannot make slides of shaded or rendered displays.

To create a slide, follow these steps:

1.Display the view of the drawing that you want to save as a slide.

2.Type mslide .

3.In the Create Slide File dialog box, choose a location and name for the slide. Its extension will automatically be .sld.

4.Choose Save.

Viewing slides

After you have created your slides, of course you want to look at them! To view a slide, follow these steps:

1.Type vslide .

2.In the Select Slide File dialog box, choose the slide you want to view.

3.Choose Open to display the slide.

Do a Redraw to return to your drawing. You cannot draw in or edit a slide.

On the

The drawing used in the following Step-by-Step exercise on creating and using a script file,

CD-ROM

ab30-b.dwg, is in the Drawings folder on the CD-ROM.

STEP-BY-STEP: Creating and Viewing Slides

1.Open ab30-b.dwg from the CD-ROM.

2.Save the file as ab30-02.dwg in your AutoCAD Bible folder.

3.Type hide to hide the drawing.

916 Part VI Customizing AutoCAD

4.Type mslide . In the Create Slide File dialog box, click the Save In drop-down box and select your AutoCAD Bible folder, if it isn’t already selected. In the File Name text box, change the name from its default of ab30-02.sld to ab30-02a.sld. Click Save.

5.Choose View 3D Views Viewpoint Presets. Change the value in the From XY Plane text box to 60 and click OK.

6.Issue the MSLIDE command again. This time, save the slide as ab30-02b.sld.

7.Choose View 3D Views Viewpoint Presets again.. Change the value in the From XY Plane text box to 90 and click OK.

8.Issue the MSLIDE command again and save the slide as ab30-02c.sld.

9.Click Zoom Previous on the Standard toolbar until you see the message No previous view saved.

10.Type vslide . In the Select Slide File dialog box, choose the first slide, ab30-02a.sld. Click Open. AutoCAD displays the slide.

11.Repeat the VSLIDE command and display ab30-2b.sld. Do the same with ab30-02c.sld.

12.Click Redraw All on the Standard toolbar.

13.Save your drawing.

Using scripts to create slide shows

You can create a script file that displays slides one after another, resulting in a slide show. You can use two special script file commands for this purpose:

DELAY nnnn pauses the script for the number of milliseconds you specify. For example, DELAY 3000 pauses the script for 3 seconds.

RSCRIPT repeats the script from the beginning. Use this command to create a continuously running script. To stop the script (whether repeating or not), press Esc or backspace, or drop down any menu.

RESUME restarts a script file after you’ve stopped it.

The VSLIDE command, which displays a slide, can also be used to preload the next slide into memory. You use this command to preload a slide while viewers are looking at the previous slide. This reduces the waiting time between slides. To use this feature, put an asterisk (*) before the filename in the VSLIDE command. The next VSLIDE command detects that a slide has been preloaded and displays it without asking for the slide name. Here’s how it works:

1 vslide ab30-02a

2 vslide *ab30-02b

3 delay 3000

4 vslide

5 vslide *ab30-02c

6 delay 3000

7 vslide

8 rscript

Chapter 30 Creating Macros and Slide Shows with Script Files

917

This script file does the following:

Line 1displays ab30-02a.sld.

Line 2 preloads ab30-02b.sld.

Line 3 waits 3 seconds, displaying ab30-02a.sld.

Line 4 displays ab30-02b.sld.

Line 5 preloads ab30-02c.sld.

Line 6 waits 3 seconds, displaying ab30-02b.sld.

Line 7 displays ab30-02c.sld.

Line 8 repeats the script from the beginning.

STEP-BY-STEP: Creating a Slide Show

1.Open Notepad and type the following script:

vslide ab30-02a vslide *ab30-02b delay 3000 vslide

vslide *ab30-02c delay 3000 vslide

delay 3000 rscript

2.Remember to press Enter at the end of the last line. Save the file as ab30-02.scr in your AutoCAD Bible folder. Close Notepad.

3.So that AutoCAD can find the slide files, place your AutoCAD Bible folder in the support file search path. To do this, choose Tools Options and click the Files tab. Click Support File Search Path and click Add. Click Browse and find your AutoCAD Bible folder. Click OK twice.

4.In any drawing, choose Tools Run Script. Locate ab30-02.scr in your AutoCAD Bible folder and click Open. The slide show runs. Notice that the last slide still takes a while to display.

5.Let the slide show run through twice. The last slide displays a little more quickly the second time. Press Esc to stop the slide show.

6.Don’t save your drawing.

Tip

When running a slide show, you might want to maximize the screen area by reducing menu

 

and command-line space. You can unload your menu, thus quickly dismissing toolbars from

 

the screen. Drag the top border of the command-line area downward to reduce the number

 

of lines of text to show on the command line to 1. Remember that when you unload the

 

menu, you have no menus available. You can reload the menu by following the instructions

 

for unloading and loading menus in Chapter 33.

918 Part VI Customizing AutoCAD

Creating Slide Libraries

You can organize your slides into slide libraries. Slide libraries have an extension of .slb. One reason for creating slide libraries is to create image tiles when you’re customizing your menu. If you’re using AutoCAD, you can see an example of an image tile menu, choose Draw Surfaces 3D Surfaces. These image tiles are created with slides organized into libraries.

To view slides in a library, use the following format:

library(slidename)

Say that you placed the three slides used in the preceding Step-by-Step exercise in a slide library called 3dmodel.slb. You would then use the following command in the script file to preload the second slide (the second line of the script file):

vslide *3dmodel(ab30-02b)

To create a slide library, you need to use the DOS prompt. You use the SLIDELIB utility, which you can find in your AutoCAD 2005 or AutoCAD LT 2005 folder.

To get to the DOS prompt, choose Start Programs Accessories Command Prompt.

Follow these steps to create a slide library:

1.Create a text file (you can use Notepad) containing the names of the slide files. Include the paths of the slide files if they’re not in the support-file search path. Place each slide filename on a new line. Save the file as ab30sld.lst, for example.

Tip

SLIDELIB can read a listing created using DOS’s dir command with the /b parameter, which

 

creates a simple listing of just the filenames. Therefore, you can place all the slide files in a

 

folder and redirect the dir listing to a file. For example, you can create a list named

 

ab30sld.lst by typing the following at the DOS prompt:

 

dir *.sld /b >ab30sld.lst

 

This creates the list in the same folder as the slide files.

2.Assuming that you’re still in the same folder where you created the slide file list and you want to create a library called ab30sld.slb in the same folder, type the following at the DOS prompt (substituting the actual path to your AutoCAD or AutoCAD LT program):

“c:\Program Files\ AutoCAD 2005\slidelib” ab30sld < ab30sld.lst

Note

SLIDELIB cannot accept filenames with spaces, but it can handle long filenames, provided you

 

use a character, such as an underscore where you might normally have a blank space.