Import X,Y Coordinates from Excel into AutoCAD

I am currently on vacation but wanted to share a great AutoCAD Tip from my friend the AutoCAD Trainer Guy Michael Beal. Michael always has great tips and clear instructions in his monthly “Michael’s Corner” available on the web as well as a monthly newsletter.

The following tip is from Michael’s Corner May 2009.
scr01

Prerequisite: The X and Y values need to be in a single cell in the format of X,Y for this to work. If X and Y have their own column, you will need to make the necessary adjustments to get them to X,Y format.

Instructions to Create a Drawing with X,Y Coordinates from Excel

  1. In Excel, highlight and Copy the column of X,Y coordinates to be used to generate the drawing.
  2. Open Windows Notepad (Startsubmenu All ProgramssubmenuAccessoriessubmenuNotepad).
  3. Before pasting the coordinates, type LINE as the first word in the file (this will launch the Line command when the script is run), then press [Enter].
  4. Now Paste the column of coordinates into the file and you should see something like that shown in the figure.
  5. Close and save the .SCR file (remember where you’re saving it).
  6. In AutoCAD, launch the SCRIPT command, then navigate to where you saved your file in the previous step, then select it and click Open. AutoCAD will launch the Line command then, beginning at the first set of coordinates entered, will draw line segments from one point to the next.

You may also want to consider…

  • Replacing the LINE command with the PLINE command.
  • Adding the word CLOSE as the last word in the script to have the linework close back to the start point.
  • Dragging the .SCR file out of Windows Explorer and dropping it into the drawing window.

Do you have an AutoCAD, AutoCAD Architecture,AutoCAD Mechanical, or AutoCAD MEP tips, tricks, or resources you would .like to share with the thousands of readers of this Between the Lines blog?  Send me your favorite tips, tricks and resources

16 comments

David Saenz says:

I and my fellow R/C Airplane geeks have been doing this since at least R14 to import airfoils readly available as .dat files.

Amin says:

Thanks for ur tip.
I knew this but had forgot.

John says:

You can also export the xls as a csv, rename the extension to txt, open in notepad, add the commands, I suggest PLINE, then save, and then rename extension as scr. phew!

leo says:

I am having a problem:
When i load my script (scr) file in my ACAD 2008 (full version), it seems ACAD opens up the file but it stays looping forever.
I already tried adding the CLOSE command at the bottom of the scr file but still keeps looping.
I want to plot around 120 x,y points.
Please let me know.
Thanks

ludmila says:

Wonderful!!!!

Gatatiya says:

when i run a script, how can i plot the x section of a road in AutoCad 2007?

This was very helpful.
Thank you very much!
PING:
TITLE: Getting Coordinates From AutoCAD to Excel
BLOG NAME: Between the Lines
Back in 2009 I wrote a blog post showing one method to get the X and Y coordinates from AutoCAD into Excel using a script.
Import X,Y Coordinates from Excel into AutoCAD
While this was a workable method, AutoCAD is well known to have several ways to a…

mujib says:

(Import X,Y Coordinates from Excel into AutoCAD). I found very very useful. If z is inserted, in the form ex:
2,3,4 u can see 3D lines. thanks. bye

Hello,
i’m trying to drow lines with a .scr but i need a command or way to write the .scr file in which every line start drawing from a new point(exactly the inverse of a polyline)
that because i need to do a route and not every line is attached to others
thanks

zachcurtis333@gmail.com says:

Stuck on the prerequisite… How do I get the x-cell and the y-cell to merge together into one cell that displays as x,y?
My issue is x = 300 y = 200 and when trying to merge them I get “three hundred thousand two hundred” (300,200.00)

You don’t want the cell format to be a SUM formula just a string/text.

Furky says:

Thanks!!

bob.at says:

Why using notepad and an additional file? Do the same procedure in autocad command line and it will work in the same way: – highlight and copy in Excel – type “LINE” in AutoCAD command line – “insert” the coordinates (in the command line, not in the drawing window) – finish with “Enter”
br Bob

Leave a Reply to David SaenzCancel reply