Other facilities -part-1

Here we have discussed about the use of script files and importing & exporting files. A script fileis a text file which contains a series of debugger commands. To the AutoCAD, a script file is an ASCII text file that contains a set of command line instructions and AutoCAD has to follow it – just like an actor reading from a script.

Summary

Here we have discussed about the use of script files and importing & exporting files. A script fileis a text file which contains a series of debugger commands. To the AutoCAD, a script file is an ASCII text file that contains a set of command line instructions and AutoCAD has to follow it – just like an actor reading from a script.

Things to Remember

  1. In computer programming terms, a script is a programme that will run without any interaction from the user.
  2. Mechanical symbol include different types of bolts, screw, nuts.

MCQs

No MCQs found.

Subjective Questions

No subjective questions found.

Videos

No videos found.

Other facilities -part-1

Other facilities -part-1

  1. Other Facilities

9.1 Use of Script File

A script file is a text file which contains a series of debugger commands. In computer programming terms, a script is a programme that will run without any interaction from the user. To the AutoCAD, a script file is an ASCII text file that contains a set of command line instructions and AutoCAD has to follow it – just like an actor reading from a script. The AutoCAD script files always have a file extension of ".scr".

Moreover, script files are simply a list of commands that are run as a group. Script files do not have the ability to stop and wait for user input. Many AutoCAD commands bring up a special dialog box to assist the user in the setting of system variables and in running the specific commands. When running a script, these dialog boxes are not used, as the script cannot pause for user input. Therefore, a command line menu is used while running a script file and the user must become familiar with this method of command input.

You can use a script file to automate any kind of AutoCAD command sequence. Since, Scripts are the text files that list a series of AutoCAD commands, having one script on each line. When you run the script, then AutoCAD runs each command just as you typed it from the keyboard.

An example of a script file is given below which displays 3 slides, one after other & then returns to the normal drawing view by providing the REDRAW command.

VSLIDE VIEW-01

VSLIDE VIEW-02

VSLIDE VIEW-03

REDRAW

You can see that each command is a new line & the command parameter, so, in this case, a single space separates the slide file name from the command string. In this example, you don't need to add the '.SLD' extension because the 'VSLIDE' command assumes that you want to view a slide file.

DELAY command

If you run the script shown in above example, then each slide will be displayed on the screen & then gets replaced with the next slide in no time. It does not give us sufficient time to view the slide properly. So, we need some method of delaying and pausing the slide before it moves to the next slide. The 'DELAY' command can be used to pause between each 'VSLIDE' command. If you add 'DELAY' command to the script shown in above example, then the script file would look like the one shown below:

VSLIDE VIEW-01

DELAY 6000

VSLIDE VIEW-02

DELAY 6000

VSLIDE VIEW-03

DELAY 6000

REDRAW

Syntax for the 'DELAY' command: DELAY Time in milliseconds

There are 1000 milliseconds in a second, therefore there is a pause of 6 secs between each slide in the given script in above example. Any number that exists between 1 and 32767 can be used with the 'DELAY' command. This means that the slide can be paused between any 2 commands form 1 milliseconds to just under 33 secs. And, if you want to pause the slide for more than 33 secs, then you could simply use 2 'DELAY' commands, one after the other.

RESCRIPT command

The script gave above displays each slide views the next slide by pausing for 6 secs and used the 'REDRAW' command in order to return to the normal viewing. But, sometimes you may desire to have a loop of the script such that when it gets to the end of the script then it starts again at the top. You can do this by using the 'RESCRIPT' command & then create a rolling slide show that will continue to repeat itself until we stop it. In order to change the script given above into a loop, you just need to put 'RESCRIPT' command in place of 'REDRAW' command.

Then the script would look like the one given below:

VSLIDE VIEW-01

DELAY 6000

VSLIDE VIEW-02

DELAY 6000

VSLIDE VIEW-03

DELAY 6000

RSCRIPT

Remember that you should always end up a script file with a carriage return. If you don't do so the script will pause indefinitely & the last command won't be issued. In the above-given example, you must add a carriage return after 'T' of the 'RESCRIPT' command. Many users make this common mistake while preparing script files. It is also difficult to find out the mistake because the script file does not look any different.

RESUME command

You can hold the operation of a script by pressing the Backspace key on the keyboard at any time you desire. For instance, let's suppose you are giving a presentation and you want to pause the slide for a little longer in order to talk about it, then you can hit the Backspace key. So, once you hit the Backspace key the slide will stop and you can then briefly talk about that particular slide without any panic. Now, if you want to continue the slide you paused, you can use the 'RESUME' command. You just have to type 'RESUME' in the command line & the script that you paused by hitting the Backspace key will automatically restart from that particular point.

Slideshows

Scripts

In a Word Processor, it creates a series of commands to execute in AutoCAD.

It saves the script file with an extension called .SCR.

Pausing a Slide

  1. Type DELAY in the command line

Command: DELAY

Enter the delay time (in millisecs.): 2000

NOTE: 2000 millisecs. is 2 seconds

Running a Script in AutoCAD

  1. Type SCRIPT in the command line

Command: SCRIPT

  1. Pick the SCRIPT name to run

By using the SCRIPT command you can start the operation of a script file.

The 'SCRIPT' command uses different familiar file dialog box, but displays only '.SCR' files. In order to run a script, you need to highlight the script file you like & then hit 'OK' button at the bottom of the 'Select Script File' dialog box.

Creating a 'Walk Through'

Until now we have covered all the required commands so that we can put together a walk through. To recall, the steps to create a simple walk through are listed below:

  1. First, you create a 3-Dimensional drawing of your own design scheme.
  2. Make a decision on the position of camera & target points & then use 'DVIEW' in order to construct a perspective view.
  3. Save perspective view as a 'Named View' by using the 'DDVIEW' command.
  4. Shade perspective view by using the 'SHADE' command, you can consider different 'SHADEDGE' options.
  5. Create a slide file from the shaded view by using the 'MSLIDE' command.
  6. Repeat the steps 2-5 for each one of the views you like to use as a part of the walk through.
  7. Use text editor in order to write the script file that will display your slides.
  8. Run the script file by using the 'SCRIPT' command.

All of the illustrations above has focused on producing slide shows that are composed of perspective views, but you can use the slides to display any views of an AutoCAD drawing. For instance, you may desire to initiate a presentation with a fine logo & some introductory text. You may create slides from the paper space, so you could add annotations to your perspective or any other views. You should be very creative in using your slides & scripts & then also consider using the script files for other purposes.

Repeating a Script

  1. Type RSCRIPT in the command line

Command: RSCRIPT

This will repeat the script command lines continuously

9.2 Working with Standard Symbols

  1. Standard symbols like that used in Mechanical, Civil, Construction, Architecture, etc. can be used directly from the standard symbols available in AutoCAD.
  2. Mechanical symbol includes different types of bolts, screw, nuts.

Lesson

9. Other Facilities

Subject

Mechanical Engineering

Grade

Engineering

Recent Notes

No recent notes.

Related Notes

No related notes.