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 modifing 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.
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 a drawing name. To avoid compatibility problems
between AutoCAD and UNIX, use only lower case letters.
Various kinds of shapes and objects are available under the Draw menu.
Some useful commands under this menu are:
- Line
- To draw a straight line from one point to another. A sequential set of
points creates a connected series of line elements.
- PLine
- 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.
- 3dface
- 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.
- Circle
- To draw a circle in a variety of ways using radius, diameter, arcs, chords,
etc. as parameters.
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.
- Move
- To move one or more element(s) from one location to another.
- Rotate
- To rotate one or more element(s) in reference to a point by some rotation
angle.
- Scale
- To enlarge or reduce one or more element(s) by some scale factor.
- Copy
- To make a copy of one or more element(s) and place them in another
location.
- Array
- To make copies of one or more element(s) and place them in either a
rectangular (rows and columns) configuration, or polar (circular)
configuration.
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.
- Vpoint
- 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.
- Zoom
- To adjust the current viewing distance.
- Pan
- To shift the "drawing" view, i.e. visible portion of a drawing, without
changing the viewing distance or moving objects.
- Redraw
- To get rid of construction markers generated intermittently.
- Regen
- To completely recalculate the displayed model.
- Hide
- To remove elements that are not visible from a given view point and to
generate realistic image of the drawing elements.
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 and 02_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 02_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 02_name. AutoCAD will search for and load the
appropriate file.
- Save
- 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.
- ^C
- 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.
- Help
- 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.
- Undo
- To undo one or more commands executed previously.
- Redo
- To redo the last command that was undone by the undo command.
Unlike undo, this can only be used to recall one step.
Other useful drawing commands include: 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.
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 an AutoCAD
drawing, the 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
u02/ with extension .lsp (for example, name.lsp). Load the file into AutoCAD by
typing: (load "name") at the command prompt. This should generate the same
results as earlier. Remember, 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 those
changes.
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 following lectures.
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.
* Draw a shape composed of one polyline with the following vertex coordinates:
(1 1 0), (2 1 0), (2 2 0), (1 2 0), "c"- i.e. close it by
connecting with the first vertex. Its starting width and ending width is 0.1.
* Generate a polar array of the polyline element drawn earlier with following
parameters: center point of array (3 3 0), number of items in array
12, angle to fill 360, rotate object as they are copied.
* Change the thickness of all the elements to 1.5. Note that you can
do this by selecting elements in a window stretching from point (0 0
0) to point (6 6 0) or by incorporating this step at an earlier
point in the program.
* Change the view point of your drawing to (-1 -1 1).
* Remove hidden lines.
* Save the drawing as 02_name.dwg in your u02 Directory.
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
02_name.lsp. When this file is loaded into AutoCAD, it should
automatically generate a drawing as shown below. Save your drawing file as
02_name.dwg. Submit both the macro and drawing file by copying them in
directory /homes5/prog/abgabe.
This website has been archived and is no longer maintained.