Jump to content
sjm

How to import Excel x,y,z data into AutoCAD

Recommended Posts

Dave92983
A possible solution: draw the points and use a script to put the texts near them. It is a poor approach since there is no connection between the points and the texts.

Use Excel to generate a script file.

Assuming X is stored in the column A, Y in B and the text in C, enter in D1 the formula:

=concatenate("text_",A1,",",B1,"_",2.5,"_",0,"_",C1,"_")

Replace the underscores with spaces, I used underscores to clearly mark where to put spaces.

Here are the explanations: First you instruct AutoCAD that you wish to start the TEXT command. Put a space after it –it will act like the Enter. A1 and B1 are the cells where the cords are, separated by a comma.

Again a space (read: Enter)

Enter the text height (only if you don’t use a fixed height text style) fallowed by a space.

Enter the rotation angle -zero is for horizontal, but you may enter any legal value, and again a space

Enter the address of the text to be placed on the screen: C1

A final space will terminate the command.

Once you get the first line, select D1, click and hold the black dot in the right down corner and drag it down to apply the function to all the lines.

Click the column head D (right the letter D) and all the column should be selected. Press CTRL+C, open Notepad and paste the text. Add an extra CR and save the file as Anyname.SCR

Drag this file in AutoCAD’s drawing area.

Of, and I would disable the snap before that.

 

An other approach could be to place in the drawing blocks containing a point and an attribute. The way is similar, just use the "Insert" command instead of "Text" and provide the answers as AutoCAD expects them.

[ATTACH]13943[/ATTACH]

 

what do you mean "extra CR"?

Share this post


Link to post
Share on other sites
fuccaro

Just press ENTER to indicate the end. CR means "carriage return" -it comes from the old typewriters when people had to pull a handle to return the moving part of a mechanism at evry new line. I admit that these days it sounds old, but computer users will relize that it means "enter". It is ASCII 13 (or ASCII 13 followed by ASCII 10 if it goes to the next line).

Share this post


Link to post
Share on other sites
Dave92983
Just press ENTER to indicate the end. CR means "carriage return" -it comes from the old typewriters when people had to pull a handle to return the moving part of a mechanism at evry new line. I admit that these days it sounds old, but computer users will relize that it means "enter". It is ASCII 13 (or ASCII 13 followed by ASCII 10 if it goes to the next line).

 

Oh thanks for the info. You sparked my interest and a long research session in character coding. There sure is a lot of history to it.

 

Ive been trying to write a script to plot leaders with annotative text labels from xyz data and a label title column. I tried using the method you explained for ploting text labels but the problem is once the "leader" command is started and the start point and landing point are given, the text I place for the command path doesn't go into the leader text box. Also I can't find a command that ends the leader command. It just keeps asking for the next line of text if you use a space (" ") for enter.

 

Any ideas?

Share this post


Link to post
Share on other sites
alicivel

thank you very much

Share this post


Link to post
Share on other sites
kilany

you can by in excel and select point,multi point in autocad page and make

paste

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...