Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plotting Lines from an Excel table in AutoCAD 1

Status
Not open for further replies.

Nelly123

Civil/Environmental
Aug 25, 2004
2
0
0
GB
Is there an easy way to plot a line from a list of entries in a Excel table? The problem is that i have a large table in Excel with survey levels and wish to save time inserting them into CAD.

I have been simply drawing them in as polylines in the past, which is a labourious process, any help would be much appreciated
 
Replies continue below

Recommended for you

Yes there's an easy way. Get your point data into the format of:

x1,y1
x2,y2
etc...

by saving an Excel file in csv format, or by using the "concatenate" function in Excel. In AutoCAD start the line or polyline commad. Then paste in the "x,y" data from the Excel file or from the .csv file, into the AutoCAD command line. Presto!
 
Hi there,
I've a similar problem to the one above. Is there an easy script to short cut the copy and paste method. I've got about 200 lines to import from an excel spreadsheet.
I've tried using the following.
line
x1,y1
x2,y2
etc
but end up with lines that are not straight but on an angle?? If I type the same co-ord in by hand the line is straight

Also when I have tried doing it the method mentioned above ,a couple of lines at a time, it works but I end up getting a line joining the end of the last line to the start of the next.

 
It sounds like you may have some extraneous spaces after the x,y data, which acts as a "return" in AutoCAD.

To get x,y data in one column for copying/pasting, the formula in column A would be something like:

=B1&","&C1
 
Thanks CarlB,
Managed to get the lines imported using the script method. Still a little problem being that the lines once imported should be seperate line but are joined ie end of one to start of the other. is there a command I can put into the .scr file to divide these line? With 250 lines I don't exactly want to have to add each one individually.

Cheers
mpw
 
The problem is there needs to be a separate "line" command for each segment. The way you have it the line command is running continuous using each endpoint. You need a space or a return after each pair of points, then another space in front of the next pair to repeat the line command. Either of the following should work:

Line
x1,y1
x2,y2
[blank Line -ends line command]
[blank line - restarts the line command]
x3,y4
x5,y5
etc.......

-OR-

Line
x1,y1 x2,y2
[2 blank lines, or line with 1 space, or no line but 2 spaces at end of preceding line]
x3,y3 x4,y4
etc...
 
Status
Not open for further replies.
Back
Top