- •Contents
- •Contents at a Glance
- •Acknowledgments
- •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
- •Foreword
- •Credits
- •About the Author
- •Summary
- •AutoCAD’s Advantages
- •Comparing AutoCAD and AutoCAD LT
- •Starting AutoCAD and AutoCAD LT
- •Creating a New Drawing
- •Using the AutoCAD and AutoCAD LT Interface
- •Creating a New Folder
- •Using the Interface
- •Saving a Drawing
- •Closing a Drawing and Exiting from AutoCAD and AutoCAD LT
- •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 and Dynamic Input
- •Command Techniques
- •Of Mice and Pucks
- •Getting Help
- •Summary
- •Typing Coordinates
- •Displaying Coordinates
- •Picking Coordinates on the Screen
- •Overriding Coordinate Settings
- •Locating Points
- •Summary
- •Choosing Unit Types
- •Drawing Limits
- •Understanding Scales
- •Creating a Title Block
- •Specifying Common Setup Options
- •Customizing with the MVSETUP Command
- •Using the Setup Wizards
- •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
- •Using the ZOOM Command
- •Using Aerial View
- •Saving Named Views
- •Working with Tiled Viewports
- •Using Snap Rotation
- •Understanding User Coordinate Systems
- •Creating Isometric Drawings
- •Summary
- •Editing a Drawing
- •Selecting Objects
- •Summary
- •Copying and Moving Objects
- •Resizing Commands
- •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
- •Customizing the spelling dictionary
- •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
- •Creating and Using Dynamic 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
- •Displaying 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 the Customization File
- •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
- •Summary
- •A Final Word
- •Installing AutoCAD and AutoCAD LT
- •Configuring and Using Workspaces
- •Configuring AutoCAD
- •Starting AutoCAD Your Way
- •Configuring a Plotter
- •Discovering AutoCAD and AutoCAD LT
- •Accessing Technical Support
- •Autodesk User Groups
- •Internet Resources
- •System Requirements
- •Using the CD-ROM with Microsoft Windows
- •What’s on the CD-ROM
- •Troubleshooting
- •Index
970 Part VI Customizing AutoCAD
Taking Script Files to the Max
What if you want to execute that multi-cleanup script file on 200 drawings? Typing in all of those file names would take so long that you would wonder if you were saving any time.
However, you can save time. First, you need to find a text editor or word processor that can create vertical blocks of text. This means that you can select columns of text rather than lines of text. You can do this in Microsoft Word by holding down Alt and dragging down the text. (Using a fixed-width font, such as Courier New, makes selecting columns of text easier.) Then, you need to format the script file so that the entire set of commands is in one row, as in the figure shown here. In Microsoft Word, you can use Page Setup to set the paper to landscape and make it as wide as you need so that the text doesn’t wrap. (Of course, you type the script once, and then copy the line and paste it as many times as you need.) You do this so that all of the file names will be in one column. Here you see the path but no file name at the end of each line. The file name will be inserted before the quotation mark at the end of each line.
Now, open a DOS window. (From the Windows taskbar, choose Start Programs Accessories Command Prompt.) Use the DOS cd command to navigate to the folder where all of your drawings are located. (They should all be in one folder.) Type dir *.dwg /b >dwglst.txt and press Enter. This creates a listing of all of the files in that folder, and places it in a text file named dwglst.txt. The /b parameter creates a file that contains only the names of the drawings.
Open the file in a text editor or word processor that can create vertical blocks. Create a vertical block over the drawing names and copy it to the Clipboard.
Open the script file in the same text editor or word processor, place the cursor at the top-left corner of the vertical block, and paste. You should get all of the drawing names inserted in the right place, as shown here with two drawings. If you’re in a word processor, don’t forget to save the file as a Text Only document.
Used in this way, the script files feature can be an extremely powerful tool for editing large numbers of drawings in one batch.
Creating Slide Shows
You can create an image from the display on your screen and save it as a slide. You can then use several of these images to create a slide show. You can use script files to direct the timing and order of the slide show. You first save a view of a drawing as a slide, then create a slide library from the slides, and then show the slides one after another automatically.
Chapter 30 Creating Macros and Slide Shows with Script Files |
971 |
Tip |
You can save any drawing as an image file and import it into a presentation program that cre- |
|
ates slide shows, such as Microsoft PowerPoint, Lotus Freelance Graphics, Corel Presentations, |
|
or OpenOffice.org Impress. You can add text and special effects to create a professional slide |
|
show. For more information, see Chapter 27. |
Creating slides
Creating a slide is like capturing a screen shot 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 create a slide of a wireframe or hidden display. However, you cannot make a slide of a shaded or rendered display.
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 file extension will automatically be .sld.
4.Choose Save.
Viewing slides
After you have created your slides, you will 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 that 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 exercise on creating and viewing slides, ab30-b.dwg, is |
CD-ROM |
in the Drawings folder on the CD-ROM. |
STEPS: 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.
4.Type mslide . In the Create Slide File dialog box, click the Save In drop-down menu 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 then click OK.
6.Issue the MSLIDE command again. This time, save the slide as ab30-02b.sld.
972 Part VI Customizing AutoCAD
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.Enter redraw all on the command line..
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 that 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 file name 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
This script file does the following:
Line 1 displays 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.
Chapter 30 Creating Macros and Slide Shows with Script Files |
973 |
Line 7 displays ab30-02c.sld.
Line 8 repeats the script from the beginning.
Note The Dynamic Input feature sometimes interferes with a slide show. If so, turn off Dynamic Input (click the DYN button on the status bar) before running the slide show.
STEPS: 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.To ensure 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 then 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 use the CLEANSCREEN command (press Ctrl+0) to toggle |
|
the toolbars and palette windows on and off. You can also hide (and redisplay) the command |
|
line window by pressing Ctrl+9. |
Creating Slide Libraries
You can organize your slides into slide libraries. Slide libraries have a .slb file extension. One reason for creating slide libraries is to create image tiles when you’re customizing your menu. If you’re using AutoCAD, then you can see an example of an image tile menu by choosing 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)
