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.
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
- In Excel, highlight and Copy the column of X,Y coordinates to be used to generate the drawing.
- Open Windows Notepad (Start
All Programs
Accessories
Notepad). - 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].
- Now Paste the column of coordinates into the file and you should see something like that shown in the figure.
- Close and save the .SCR file (remember where you’re saving it).
- 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
I and my fellow R/C Airplane geeks have been doing this since at least R14 to import airfoils readly available as .dat files.
OSNAPs OFF first!
Thanks for ur tip.
I knew this but had forgot.
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!
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
Wonderful!!!!
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…
Gatatiya,
PLease try the method posted today in this blog at http://autodesk.blogs.com/between_the_lines/2012/08/getting-coordinates-from-autocad-to-excel.html
Best Regards,
Shaan
(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
What you sound to be attempting is not easy, and perhaps better to do with a LISP file instead of a script. If you need some tips you can check out the peer experts in the AutoCAD customization forum.
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/bd-p/130
Best Regards,
Shaan
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.
Thanks!!
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