680 likes | 685 Vues
Script Files and Slide Shows. Sacramento City College Engineering Design Technology. Slides and Slide Shows. Slides and Slide Shows. A slide in AutoCAD Is similar to a slide in photography. Is a snapshot of graphics screen display. Cannot be edited or plotted .
E N D
Script Files and Slide Shows Sacramento City College Engineering Design Technology Script Files and Slide Shows
Slides and Slide Shows Script Files and Slide Shows
Slides and Slide Shows • A slide in AutoCAD • Is similar to a slide in photography. • Is a snapshot of graphics screen display. • Cannot be edited or plotted. • Can be viewedone at a time on the screen. • A continuous slide show can be created. Script Files and Slide Shows
Slides and Slide Shows • Slides are excellent for • Demonstrations. • Presentations. • Displays. Script Files and Slide Shows
Slides and Slide Shows • A slide show • is a group of slides that are displayed at preset time intervals. • The display of the slides is controlled by a script file. • A script file is a logical sequence of validAutoCAD commands stored in a .txt file. Script Files and Slide Shows
Slides and Slide Shows • To make slides • Display the drawing for which you need a slide. • Select the MSLIDE command • Pick the drive and folder in which the file is to be stored. • Enter the file name in the File name: text box for the slide • Pick the Save button. • AutoCAD automatically attaches an .sld file extension. Script Files and Slide Shows
Slides and Slide Shows • Choose location where slides will be stored. • AutoCAD by default stores slides in the AutoCAD directory. • This is not a good location for slides. • Keep the AutoCAD directory free of drawing, slides, and AutoLISP files. Script Files and Slide Shows
Slides and Slide Shows • Good locations for slides • Local hard disk drive • USB media • Create a separate folder in the location where you choose to store slides. Script Files and Slide Shows
Naming Slides Script Files and Slide Shows
Slides and Slide Shows • Slide names should follow a pattern. • Name the slide to reflect the • Client name or • Project number • Examples: • weyersld01, weyersld02, etc. • 4305sld01, 4305sld02, etc. Script Files and Slide Shows
Slides and Slide Shows • To view a slide, type VSLIDE • Command: VSLIDE • The Select Slide Filedialog box appears. • Pick the slide you want to display • Pick OK. • The slide is displayed in the graphics window. Script Files and Slide Shows
Creating Script Files to Automate AutoCAD Script Files and Slide Shows
Slides and Slide Shows • A Script File • is a list of valid AutoCAD commands stored in a text file. • Is created using a wordprocessor. • Notepad • MS DOS EDIT • Has a .scr file extension Script Files and Slide Shows
Slides and Slide Shows • Running the Script file • When the script file is read by AutoCAD, the entire list of commands is performed without additional input from the user. Script Files and Slide Shows
Slides and Slide Shows • A Script File contains valid AutoCAD commands in a specific sequence. • VSLIDE (AutoCAD command - displays slide) • DELAY (A slide display time) • VSLIDE • DELAY • RSCRIPT (AutoCAD command to cause the show to repeat.) • Three blank lines at the end of the file. Script Files and Slide Shows
Creating Script Files • Scripts enable nonprogrammers to automate AutoCAD functions. • Scripts can be used for specific functions, such as • Plotting a drawing with the correct PLOT command values and settings • Creating a slide show. Script Files and Slide Shows
Writing Script File - Basic Rules Script Files and Slide Shows
Creating Script Files • When writing a script file, • 1. Use one command or option per line. • Makes the file easier to fix if the script does not work properly. • 2. Press [Enter] after typing a command. • 3. A blank line = [Enter] • If the next option of a command is a default value to be accepted, press [Enter] again. • This leaves a blank line in the script file, which represents pressing [Enter]. Script Files and Slide Shows
Creating Script Files • When writing a script file, • 4. A space = [Enter] • 5. A blank line = [Enter] • 5. Three blank lines are required at the end of the script file. Script Files and Slide Shows
Writing a Slide Show Script File Script Files and Slide Shows
Writing a Slide Show Script File • A slide show script file • Contains only three AutoCAD commands. • VSLIDE. • DELAY. • VSLIDE. • DELAY. • VSLIDE. • DELAY. • RSCRIPT. Script Files and Slide Shows
Writing a Slide Show Script File • A slide show script file • Can be a single pass or continuous show. • If RSCRIPT and three blank lines are included • The slide show will repeat • If not included • The slide show will run one time only. Script Files and Slide Shows
Writing a Slide Show Script File • VSLIDE displays a slide. • The name of the slide follows the command. • VSLIDE kenslide01 Script Files and Slide Shows
Writing a Slide Show Script File • An asterisk (*), in front of the slide file name causes the next slide to be preloaded. • VSLIDE kenslide01 • VSLIDE *kenslide02 • DELAY • VSLIDE • A VSLIDE command that is notfollowed by a slidename displays the pre-loaded slide. Script Files and Slide Shows
The DELAY Command • DELAY • Specifies the display time in milliseconds • Maximum delay = 33 seconds (33,000) • Examples: • DELAY 33000 (33 second delay) • DELAY 4000 (4 second delay) Script Files and Slide Shows
The RSCRIPT Command • RSCRIPT is used at the end of a script file. • RSCRIPT causes the script file to repeat. • Exactlythree blank lines • MUST be entered at the end of the script file. • The script will NOT run correctly without them. Script Files and Slide Shows
The RESUME Command • RESUME • Restarts the slide show where it left off • (Sometimes) • Does not always work correctly. • Any script file can (theoretically) be interrupted and restarted using RESUME. Script Files and Slide Shows
Writing A Script File - Example Script Files and Slide Shows
Writing a Slide Show Script File • The following script uses four slides. • Each slide appears for three seconds. • The script repeats. • The next slide is preloaded while the previous one is viewed. Script Files and Slide Shows
Writing a Slide Show Script File • When storing slide files, include in the script file, the • disk drive letter and • path in front of the file name. • Example: F:cadlsld2 • Use this method with each VSLIDE command. Script Files and Slide Shows
Viewing the Slide Show Script Files and Slide Shows
Viewing the Slide Show • Start the slide show by • Entering SCR or SCRIPT at the Command: prompt • OR • Picking Run Script... from the Tools pull-down menu. • OR • Select the script file name show.scr from the Select Script File dialog box. Script Files and Slide Shows
Viewing the Slide Show • The commands in the script file are displayed at the Command: prompt window as the slides appear. • To stop the show, • Press the [Backspace] key or • [ESC] key. Script Files and Slide Shows
Troubleshooting the Slide Show Script Files and Slide Shows
Troubleshooting the Slide Show • To correct, problems in your script file. • 1. Run the script to see where it crashes (quits working). • 2. Check the command line for the last command that was executed. Script Files and Slide Shows
Troubleshooting the Slide Show • 3. Look for error messages, such as: • Can't open slide file xxxxx (Incorrect slide file name). • xxxxx Unknown command (Command spelled incorrectly or a space left at the end of the line). • Requires an integer value (Delay value not all numerical characters. Possibly a space at the end of the line). Script Files and Slide Shows
Troubleshooting the Slide Show • 4. Correct the problem in the script file and save the file. • 5. Test the script. • The most common errors are • Misspelled commands. • Spaces at the end of lines. Script Files and Slide Shows
Troubleshooting the Slide Show • The process of “debugging” the script file is performed by • AutoCAD open in one window • Script file open in a NOTEPAD window. Script Files and Slide Shows
Troubleshooting the Slide Show • Alt-TAB between the windows • Run Script file • Find location where it stops • Switch to NOTEPAD window with Alt-TAB • Correct mistake • SAVE the script file! • Go back to AutoCAD using Alt-TAB • Run script file again. • Repeat steps over and over until script works. Script Files and Slide Shows
Troubleshooting the Slide Show • Watch for extra spaces! • If you suspect there is a space at the end of a line, it is best to delete the line and retype it. • If you use Notepad or EDIT, • It is easy to see if a space exists. • The flashing cursor, when placed at the end of a line, does not rest on the last character. Script Files and Slide Shows
Using Text Editors Script Files and Slide Shows
Using Text Editors • Word processing or text editor programs can be used to write scripts. • The program must be capable of saving the file in “ASCII” format. Script Files and Slide Shows
Using Text Editors • ASCII is an acronym for • American Standard Code for Information Interchange. • Computer ASCII text files can be created with: • The MS-DOS EDIT text editor • Windows Notepad • Windows WordPad. Script Files and Slide Shows
Using Text Editors • Word processing files must be saved in ASCII format to be readable by AutoCAD. Script Files and Slide Shows
Using Text Editors • Typical commercial wordprocessing programs: • Windows WordPad. • Microsoft Word. • Corel WordPerfect. • Ami Pro. • Do NOT save in ASCII format by default! • You must choose option to save as .txt file Script Files and Slide Shows
Using Wordprocessors • If you choose to use a word processor, save the document as a text file. • This prevents the inclusion of special formatting codes. Script Files and Slide Shows