Jump to content

Coordinates from Excel to AutoCAD


TheStig

Recommended Posts

You can convert your excel file to a script file, and then run it in autocad.

Script files are basically compiled autocad commands in written in Notepad. Simply copy and paste your coordinates to a notepad file (make sure the coords are space delimitted). Preceed your coordinates with the pline command, and then save the notepad file in a logical location. Then go to your autocad file, use the tools menu and select "Run Script...," and select the file you created. Script files are a bit tricky to run if you aren't careful where you place spaces. You also cannot use aliases or transparent commands in script files. It helps to practice on a few short plines, and see the results before you deal with a large group of coords.

Link to comment
Share on other sites

The easiest way is to create a formula that builds a text string that AutoCAD understands, then start the polyline command, and copy the cells that contain the formula and paste them to the command line (make sure you paste to the command line and not into the drawing window)

 

Just "add" (concatenate) the data together with the '&' symbol (or the concatenate formula if you are writing your own formula in visual basic)

 

Example: to draw a rectangle

 

EXCEL sheet

----A--|- B--|---- C-----

1 100 100 =char(8)&A1&","&B1

2 200 100 =char(8)&A2&","&B2

3 200 200 =char(8)&A3&","&B3

4 100 100 =char(8)&A4&","&B4

 

Because Excel puts a " at the beginning of text, the char(8) is the ASCII code for backspace to clear it.

 

Type 'pline' at the command line in Acad, then copy C1 thru C4 and paste them.

 

Incidentially, you can take this to the next level and build text strings that include the autocad command. For instance, it is pretty easy to build a command in an excel formula that inserts a block at a point, scales it, fills out attributes, then draws a line to the next point, and so on.

 

good luck

Link to comment
Share on other sites

Hi Guys,

 

I tried both methods using a simple square and they both worked. Unfortunately when it got a little more complicated the copy and paste method worked but when I tried the run script method it only seemed to plot every other point. I tried adding and removing spaces, returns etc. but with no results.

Any suggestions?

 

Cheers

 

Stig

Link to comment
Share on other sites

The easiest way to check your script file is to run it in Autocad and look at the command line screen to see where it stops working, then you can go back to that point in your script file and make appropriate corrections. The problem with a script file is that there can be a lot of trial-and-error. Another way to help check for any errors is to write the script file in MS Word or some other program that can show spaces and "enter" commands, and then save the file as a ".scr" file. If you showed me a sample of what your script file looks like, especially where it fails you, I might be able to help. Good luck.

Link to comment
Share on other sites

  • 4 years later...
  • 4 months later...
Is there any way of importing the point number aswll as the X and Y ?

 

Good question. Any answers? I use Autocad2007LT.

 

I have an Excel spreadsheet.

 

Column A (x) and B (y) have the (9 digits) coordinates. Column C the follow up point number

116746000 514240000 1

116748000 514244000 2

116750000 514251000 3

116751000 514256000 4

.....

xxxxxxxxx yyyyyyyyy 2500

 

What is the way to put this into Autocad LT 2007? Or is there no way?

Link to comment
Share on other sites

Ive found something like "RapidDXF 3.0" which promises to be what I am looking for. But I can not find a suitable download location because of broken links.

 

Anyone a bright idea? Thanks in advance.

 

edit: Try and find "RapidDXF 3.1".

If you know the French language, it works easily.

Edited by Thomas
version update
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...