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.
While this was a workable method, AutoCAD is well known to have several ways to accomplish anything. Between the Lines reader Brian Glackin PE provided a much easier method this week in an email to me.
A much shorter option (for one off linework) to create the lines (or plines or 3d polylines) is:
Open the excel file with your coordinate pairs
(if they are in separate columns, use =CRx&”,”&CRy in a new cell to create a text line with the pairs)
Highlight the coordinate pair dataset and hit ‘Control C’
Move back to AutoCAD
Initiate the appropriate command (pline for most of what I do)
Once the command is initiated, right click on the command line and select “Paste”
Once pasted, either hit <return> or close to end the command
If I need to use the line set on multiple drawings, I create a script file like you suggest, but for one offs a quick copy from excel /paste to AutoCAD command line during the active command works best.
Thank you Brian!