Kapitel 3

AutoCad I: Das Graphikpaket

3.1 AutoCad: Basic Concepts

AutoCad is one of the many interactive graphics programs which allows representation and manipulation of objects in the three dimensional coordinate space. A crucial concept to understand is the object model supported by an application program like AutoCad. An object like a cube may be represented by drawing only the edges of the cube. If the program cannot represent surfaces stretching between edges, it will generate only a wire-frame model of objects. If a program can generate surfaces but cannot represent material space filling the cube, it will generate only a surface model of objects. If a program can properly represent material space of an object, it can generate a solid model of objects. AutoCad program is capable of representing objects as wire-frame, surface and solid models subject to some restrictions.

In order to become familiar with AutoCad, a small number of commands are introduced in this section. To represent objects in an application, a number of primitive shapes like lines, circles, polygons, etc. are provided for drawing tasks. Occasionally, a shape that is already drawn needs some changes, e.g. moving it from one place to another. These actions are known as editing or modification functions. An object can be displayed in plan, elevation or axonometric projection, and be looked at from varying distances. These are referred to as viewing control functions. You may want to save the objects so that they can be retrieved and modified later on; these are the file related functions. Quite often you may need to suspend, undo an action or need help for command completion. These are the utility or assist functions described under SOS. There are a number of additional tasks that you can perform with AutoCad. These can only be learned with time and practise. Additional (and quite detailed) information is available in AutoCad manual copies in the lab.

Setting Up

Start AutoCad by typing acad in any shell window. Type new on the command line, click on Discard Changes and enter a file name when prompted for drawing name. To avoid compatibility problems between AutoCAD and UNIX, use only lower case letters.

3.1.1 Draw

Various kinds of shapes and objects are available under the Draw menu. Some useful commands under this menu are:
To draw a straight line from one point to another. A sequential set of points creates a connected series of line elements.
To draw a polyline element made up of one or more connected straight lines and arcs. Each subcomponent of a polyline may have a different line width. Pline generates elements in only the x-y plane of the current coordinate system.
To draw a surface defined by a number of edges in three dimensional space. Use this command if realistic models are to be generated. Enter the vertices in counter-clockwise fashion.
To draw a circle in a variety of ways using radius, diameter, arcs, chords, etc. as parameters.

3.1.2 Edit - Modify

To transform a drawing element, a number of editing operations are provided under the Edit screen menu, as well as the Modify pull-down menu.
To move one or more element(s) from one location to another.
To rotate one or more element(s) in reference to a point by some rotation angle.
To enlarge or reduce one or more element(s) by some scale factor.
To make a copy of one or more element(s) and place them in another location.
To make copies of one or more element(s) and place them in either a rectangular (rows and columns) configuration, or polar (circular) configuration.

3.1.3 Display

In AutoCad, regardless of the particular view in which objects are drawn and displayed, the program stores them in true three dimensional space. By changing the particular viewing position, other views of the elements may be generated and displayed. These commands are available under Display option.
When AutoCad is started, by default, you are working in a plan view. This command enables you to specify another view using x,y,z values.
To adjust the current viewing distance.
To shift the "drawing" view, i.e. visible portion of a drawing, without changing the viewing distance or moving objects.
To get rid of construction markers generated intermittently.
To completely recalculate the displayed model.
To remove elements that are not visible from a given view point and to generate realistic image of the drawing elements.

3.1.4 File

All the work you do in AutoCad can be saved in a file so that you can retrieve it later on and make changes, plot it out, etc. All AutoCad drawing files have the extension dwg as in 01_name.dwg, 03_name.dwg. You will see the current file name displayed at the top of the AutoCad window.

If you start a new drawing in AutoCad, you need to input only the file stem, e.g. 01_name or 03_name. The file extension will be provided by the program.

If you want to work on an existing drawing file, input only the file stem, e.g. 01_name or 03_name. AutoCad will search for and load the appropriate file.

To save all the information in the current drawing file. If you want to save it under a different name, enter a new file name. This operation does not stop or quit AutoCad, hence you can do further work if you wish. End
To save all the work under the current file name and stop AutoCad. Quit
Any changes made after the last time the file was saved, will be discarded. In this case, your drawing file will contain only those drawing elements present when the file was last saved.

3.1.5 SOS - Assist

Cancel a command in progress by holding down the keys labeled Control and C at the same time. This interrupts any ongoing command (in most cases) and displays an empty command line.
To get online help on a topic or command. To find out more about it, type help and ? If you do not want to see additional information displayed, remember to press -->C.
To undo one or more commands executed previously.
To redo the last command that was undone by the undo command. Unlike undo, this can only be used to recall one step.

3.1.6 Other Commands

Other useful drawing commands are:
layer, block, insert, text, dtext, dim, mspace, pspace.
They are explained more fully in the AutoCad manuals available in the Lab. If you need help with any of these commands, request help from a TA.

3.2 Macros

When a command is selected and executed in AutoCad, e.g. line, both the command and the arguments supplied are echoed in the command: prompt area. Another way to accomplish the same actions is to type in the command and arguments as LISP expressions. For example, suppose a line is to be drawn from point (0,0) to point (8,0) to point (8,8) to point (0,8) and back to the starting point, you can do this interactively as follows:

command: line
Start Point: 0,0
To Point: 8,0
To Point: 8,8
To Point: 0,8
To Point: c
This will generate four connected lines, forming a square shape. You could type in the coordinates for points or select them on screen using a cursor. Alternately, you can type in the following line at command: prompt exactly as shown with quote marks:
(command "line" '(0 0) '(8 0) '(8 8) '(0 8) "c")
This too will generate the same graphic elements as earlier. This LISP expression is a shorthand way of expressing a desired series of actions without touching the mouse or moving the cursor. Further, a series of such commands can be collected and placed in a separate file. When such a file is loaded into AutoCad drawing, LISP interpreter will evaluate each expression and execute each command just as if it were entered interactively. A series of such expressions collected in a file are known as macros, and they have two principal advantages. First, macros allow you to automate some routine drawing set up and generation tasks. Second, since most AutoCad commands expect you to input coordinates which are lists of the form (x y z), you can use variables which have been assigned various coordinate values (by using setq or some other LISP procedures).

Open a Text Editor window, type in the above macro, and save the file in u03 with extension .lsp (for example, name.lsp). Load the file in AutoCad drawing by typing at the command: prompt: (load "name") This should generate the same results as earlier. Remember that if you make any changes to the macro file, you have to save it and load it again into AutoCad to see the effects of any changes you may have made.

There is more to writing and making use of macros, e.g. naming macros, using AutoCad commands as part of LISP functions, executing macros from screen and pull-down menus. These topics are explained in the following lectures.

3.3 Uebung 3

This exercise is meant to test your understanding of AutoCad commands, command format and arguments using small macros which can be successfully executed in AutoCad. You have to write a text file that contains AutoCad commands for the above actions in proper format with proper argument values. Save this file as 03_name.lsp. When this file is loaded into AutoCad, it should automatically generate a drawing as shown below. Save your drawing file as 03_name.dwg. Submit both the macro and drawing file by copying them in directory /homes2/prog/abgabe.

To the next chapter

Prog Content Vorwort ..1.. ..2.. ..3.. ..4.. ..5.. ..6.. ..7.. ..8.. ..9.. ..10.. ..11.. ..12.. ..13.. Appendix

@ by Architektur und CAAD 1994.......... The Teacher Team