- •Foreword
- •Preface
- •Is This Book for You?
- •How This Book Is Organized
- •How to Use This Book
- •Doing the Exercises
- •Conventions Used in This Book
- •What the Icons Mean
- •About the CD-ROM
- •Other Information
- •Contacting the Author
- •Acknowledgments
- •Contents at a Glance
- •Contents
- •Getting Acquainted with AutoCAD and AutoCAD LT
- •Starting AutoCAD and AutoCAD LT
- •Creating a New Drawing
- •Using the AutoCAD and AutoCAD LT Interface
- •Creating Your First Drawing
- •Saving a Drawing
- •Summary
- •Creating a New Drawing from a Template
- •Working with Templates
- •Opening a Drawing with Default Settings
- •Opening an Existing Drawing
- •Using an Existing Drawing as a Prototype
- •Saving a Drawing Under a New Name
- •Summary
- •The Command Line
- •Command Techniques
- •Of Mice and Pucks
- •Getting Help
- •Summary
- •Typing Coordinates
- •Displaying Coordinates
- •Picking Coordinates on the Screen
- •Locating Points
- •Summary
- •Unit Types
- •Drawing Limits
- •Understanding Scales
- •Inserting a Title Block
- •Common Setup Options
- •The MVSETUP Command
- •Summary
- •Using the LINE Command
- •Drawing Rectangles
- •Drawing Polygons
- •Creating Construction Lines
- •Creating Rays
- •Summary
- •Drawing Circles
- •Drawing Arcs
- •Creating Ellipses and Elliptical Arcs
- •Making Donuts
- •Placing Points
- •Summary
- •Panning
- •The ZOOM Command
- •Aerial View
- •Named Views
- •Tiled Viewports
- •Snap Rotation
- •User Coordinate Systems
- •Isometric Drawing
- •Summary
- •Editing a Drawing
- •Selecting Objects
- •Summary
- •Copying and Moving Objects
- •Using Construction Commands
- •Creating a Revision Cloud
- •Hiding Objects with a Wipeout
- •Double-Clicking to Edit Objects
- •Grips
- •Editing with the Properties Palette
- •Selection Filters
- •Groups
- •Summary
- •Working with Layers
- •Changing Object Color, Linetype, and Lineweight
- •Working with Linetype Scales
- •Importing Layers and Linetypes from Other Drawings
- •Matching Properties
- •Summary
- •Drawing-Level Information
- •Object-Level Information
- •Measurement Commands
- •AutoCAD’s Calculator
- •Summary
- •Creating Single-Line Text
- •Understanding Text Styles
- •Creating Multiline Text
- •Creating Tables
- •Inserting Fields
- •Managing Text
- •Finding Text in Your Drawing
- •Checking Your Spelling
- •Summary
- •Working with Dimensions
- •Drawing Linear Dimensions
- •Drawing Aligned Dimensions
- •Creating Baseline and Continued Dimensions
- •Dimensioning Arcs and Circles
- •Dimensioning Angles
- •Creating Ordinate Dimensions
- •Drawing Leaders
- •Using Quick Dimension
- •Editing Dimensions
- •Summary
- •Understanding Dimension Styles
- •Defining a New Dimension Style
- •Changing Dimension Styles
- •Creating Geometric Tolerances
- •Summary
- •Creating and Editing Polylines
- •Drawing and Editing Splines
- •Creating Regions
- •Creating Boundaries
- •Creating Hatches
- •Creating and Editing Multilines
- •Creating Dlines
- •Using the SKETCH Command
- •Digitizing Drawings with the TABLET Command
- •Summary
- •Preparing a Drawing for Plotting or Printing
- •Creating a Layout in Paper Space
- •Working with Plot Styles
- •Plotting a Drawing
- •Summary
- •Combining Objects into Blocks
- •Inserting Blocks and Files into Drawings
- •Managing Blocks
- •Using Windows Features
- •Working with Attributes
- •Summary
- •Understanding External References
- •Editing an Xref within Your Drawing
- •Controlling Xref Display
- •Managing Xrefs
- •Summary
- •Preparing for Database Connectivity
- •Connecting to Your Database
- •Linking Data to Drawing Objects
- •Creating Labels
- •Querying with the Query Editor
- •Working with Query Files
- •Summary
- •Working with 3D Coordinates
- •Using Elevation and Thickness
- •Working with the User Coordinate System
- •Summary
- •Working with the Standard Viewpoints
- •Using DDVPOINT
- •Working with the Tripod and Compass
- •Getting a Quick Plan View
- •Shading Your Drawing
- •Using 3D Orbit
- •Using Tiled Viewports
- •Defining a Perspective View
- •Laying Out 3D Drawings
- •Summary
- •Drawing Surfaces with 3DFACE
- •Drawing Surfaces with PFACE
- •Creating Polygon Meshes with 3DMESH
- •Drawing Standard 3D Shapes
- •Drawing a Revolved Surface
- •Drawing an Extruded Surface
- •Drawing Ruled Surfaces
- •Drawing Edge Surfaces
- •Summary
- •Drawing Standard Shapes
- •Creating Extruded Solids
- •Drawing Revolved Solids
- •Creating Complex Solids
- •Sectioning and Slicing Solids
- •Using Editing Commands in 3D
- •Editing Solids
- •Listing Solid Properties
- •Summary
- •Understanding Rendering
- •Creating Lights
- •Creating Scenes
- •Working with Materials
- •Using Backgrounds
- •Doing the Final Render
- •Summary
- •Accessing Drawing Components with the DesignCenter
- •Accessing Drawing Content with Tool Palettes
- •Setting Standards for Drawings
- •Organizing Your Drawings
- •Working with Sheet Sets
- •Maintaining Security
- •Keeping Track of Referenced Files
- •Handling Errors and Crashes
- •Managing Drawings from Prior Releases
- •Summary
- •Importing and Exporting Other File Formats
- •Working with Raster Images
- •Pasting, Linking, and Embedding Objects
- •Summary
- •Sending Drawings
- •Opening Drawings from the Web
- •Creating Object Hyperlinks
- •Publishing Drawings
- •Summary
- •Working with Customizable Files
- •Creating Keyboard Shortcuts for Commands
- •Customizing Toolbars
- •Customizing Tool Palettes
- •Summary
- •Creating Macros with Script Files
- •Creating Slide Shows
- •Creating Slide Libraries
- •Summary
- •Creating Linetypes
- •Creating Hatch Patterns
- •Summary
- •Creating Shapes
- •Creating Fonts
- •Summary
- •Working with Menu Files
- •Customizing a Menu
- •Summary
- •Introducing Visual LISP
- •Getting Help in Visual LISP
- •Working with AutoLISP Expressions
- •Using AutoLISP on the Command Line
- •Creating AutoLISP Files
- •Summary
- •Creating Variables
- •Working with AutoCAD Commands
- •Working with Lists
- •Setting Conditions
- •Managing Drawing Objects
- •Getting Input from the User
- •Putting on the Finishing Touches
- •Summary
- •Understanding Local and Global Variables
- •Working with Visual LISP ActiveX Functions
- •Debugging Code
- •Summary
- •Starting to Work with VBA
- •Writing VBA Code
- •Getting User Input
- •Creating Dialog Boxes
- •Modifying Objects
- •Debugging and Trapping Errors
- •Moving to Advanced Programming
- •A Final Word
- •Installing AutoCAD and AutoCAD LT
- •Configuring AutoCAD
- •Starting AutoCAD Your Way
- •Configuring a Plotter
- •System Requirements
- •Using the CD with Microsoft Windows
- •What’s on the CD
- •Troubleshooting
- •Index
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. |