Вы находитесь на странице: 1из 2

To draw equations in AutoCAD

Any curve that can be expressed in terms of an equation in which there

exists a Y value for every value of X can be easily drawn in AutoCAD. For
the purposes of this exercise we will show how to draw a line in AutoCAD
represented by the equation y  x 3
 2 x 2
 11 x  12 where the value of x lies

between -5 and +5, calculated in 0.1 steps.

One way to solve this problem is to use Microsoft Excel ® (or another
spreadsheet package) together with Microsoft Word ® (or another similar
word processing package). Although this solution may appear to be fairly
complex, you will achieve good results if you follow these steps carefully.

1. Determine the range of the value of x. In this case we are told it is from -5 to
+5 (it may have to be found by trial and error if not known).

2. Start Excel. At the head of the first column (cell A1) put the smallest x value
(in this case -5). Press return but do not move out of the cell.

3. Pick Edit in the Worksheet Menu Bar, then Fill > Series... and in the Series
dialogue box choose Columns, a Step value: of 0.1 and a Stop value: of 5.
The cells below A1 then fill with each required X value.

4.In the B column (B1) put in a comma (,)

5. In the top of the C column (cell C1) add the formula replacing the x with A1
so that it looks like this =A1^3+2*A1^2-11*A1-12. Do not forget the
equals sign at the beginning of the formula.

6.Pick in cell B1 and drag to C1.

7. Pick the black square in the lower right hand corner of cell C1 and carefully
drag down to cell C101. The commas in the B column and the “Y” values in
column C appear.

8. With cell C101 highlighted, select all the cells from C101 to A1 by pressing
CTRL+SHIFT+HOME and copy this to the clipboard by pressing CTRL+C
or the copy icon.

9. Start Word and type pline on the first line of a new document. On the line
below (the second line) use Paste Special (From the Edit menu) using the
“Unformatted text” option, this brings the data from the spreadsheet in as
text, rather than as a table.
10. These lines of data contain tabs, which if saved as a script file will convert
into spaces which will corrupt the data. You need to use the Find and
Replace feature in Word to remove these tabs.

11. Pick Edit in the Word Menu Bar, then Replace... Pick the Replace tab, then
More > Special > Tab Character > Replace All. This has stripped all the
tabs from between the numbers and the commas.

12. What is left is the contents of a script file. After the first command (Pline) is
given, the next piece of information is the starting point (in X,Y format) of
the pline. This is given on the next line because in a script, the return used to
create a new line is used as an "enter''. The lines below this contain the
absolute coordinates of the rest of the points on the required curve.

13. Now save the document into a suitable folder using the SAVEAS command
with the name set to pline.scr and with the "Save as type" set to MS-DOS
text (*.txt).

14. Close the Word document, as the script will not be able to read it if it is left

15. Start AutoCAD, ensure that all running object snaps are off (F3) and type
SCRIPT at the command line. Find your script file and run it.

16. If a SPLINE is preferred as the curve, substitute SPLINE for PLINE in the
script. You will need to add two blank lines after the last line of data. These
lines act as returns to dismiss the requests for the start and end tangent