Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Import point number and xyz data from excel and display #

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
chriswasemann37
24819 Views, 19 Replies

Import point number and xyz data from excel and display #

I would like to import a pont number, and x,y,z, data from excel to display a point node and the point number. Any help?
Tags (2)
19 REPLIES 19
Message 2 of 20

Hi,

 

making script file will serve your issue. please read more here. >> Click <<

 

Regards,




Message 3 of 20

Hi @chriswasemann37,

 

Imad provided a great link that might get you started.  I usually do this by using a CONCATENATE function in Excel.  You are welcome to attach your Excel file and I can show you how this might be done.  There are also a variety of add-ins available in the Autodesk App Store that might make this easier for you.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 4 of 20

Assuming columns A,B,C contain the x,y,z coordinates and column D contains the label, and your data starts in row 2, place the following in cell E2 (the location of spaces is very critical):

 

=CONCATENATE("point ",A2,",",B2,",",C2," ","text ",A2,",",B2,",",C2," ",0.4," ",0," ",D2," ")

 

then fill down, copy column E to Notepad and save as a text file with the extension .scr.  You can use the script command in AutoCAD to run this script.  I have assumed a text height of 0.4 and an angle of 0.  You can change these values in the Excel concatenate function

 

qq.JPG

lee.minardi
Message 5 of 20

excellent information everyone. But here is one more question?

Can you display a two lined label. For example display point number (d2 cell) followed in second line the z elevation?
Message 6 of 20

Hi,

 

>> display point number (d2 cell) followed in second line the z elevation

Create 2 attributes for that, one for point number, the other one for z elevation.

Then make sure ATTDIA is set to 0 otherwise it might option the attedit dialog.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 20
braudpat
in reply to: chriswasemann37

 

Hello

 

Maybe you can look at the beautiful "Point Manager" Routine from Lee Mac !

http://lee-mac.com/ptmanager.html

 

Regards, Patrice

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 8 of 20

Have you personally used this routine?
Message 9 of 20
Patchy
in reply to: chriswasemann37

This only can show points, not numbers or descriptions.

There are other prog. can do it.

Let's see your excel file.

Message 10 of 20

I’ll post it tonight!
Message 11 of 20

Here's a modification to my post #4 that gives the TEXT command twice to enable two lines of text.  I tried using the MTEXT command but had difficulty getting it to accept a new line in a script.  I was able to do it with the TEXT command by using the unicode \U+000D for a carriage return.  Note that 0.5 is subtracted from the y coordinate of the second text command to offset the second line of text.  The 0.4 is the text height.Capture11.JPG

 

Here is the Excel formula to fill-down  (spaces are critical).

 

=CONCATENATE("point ",A2,",",B2,",",C2," ","text ",A2,",",B2,",",C2," ",0.4," ",0," ",D2," \U+000Dtext ",A2,",",B2-0.5,",",C2," ",0.4," ",0," ",E2," ")

 

 

Again, copy the contents of column F to Notepad and Save As a text file with the extension .scr to run with SCRIPT.

Capture12.JPG

 

 

 

 

 

lee.minardi
Message 12 of 20

Hi @chriswasemann37,

 

I am checking back to see if my post or others helped you with your problem. Please mark a post or posts as accepted solutions if they resolved the issue or give me a bit more detail on this issue so we can continue to work towards getting this solved.

 

 

 

Please hit the Accept as Solution button if a post or posts solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 13 of 20

Running the formula as a script only drew one point and the point is very small. As I’m only a beginner in AutoCAD, I’m sure there is more explanition needed. I have my units set to feet since I’m working with surveying coordinates. I’ll Post some sample data when I’m at a desk top

Message 14 of 20
braudpat
in reply to: chriswasemann37

Hello

Please run the command: DDPTYPE

Regards, Patrice
Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 15 of 20

Post the script file too so it can be analyzed to see why it is only creating one point.

lee.minardi
Message 16 of 20

After some practice I think I found the answer.  Thanks for all your help. 

Message 17 of 20

How about this, if I was to associate an excel coordinator (xyz,label) with a code #, could I import points to a specific layer based on that code?

Or is there a way to automate importing points to different layers based on criteria?
Message 18 of 20

In sheet 1 of the attached Excel file are the location of the point, columns for two labels for the point, a code #, and the layer name corresponding to the code number.  

 

x1.JPG

 

The contents of cell H2 is:

=CONCATENATE("-layer"," s ",G2,"  point ",A2,",",B2,",",C2," ","text ",A2,",",B2,",",C2," ",0.4," ",0," ",D2," \U+000Dtext ",A2,",",B2-0.5,",",C2," ",0.4," ",0," ",E2," ")

 

Note that there are two blank spaces before the word point

 

The correlation between a code# and a layer name is defined on sheet 2 as noted below.  This array of values is named "LabelTable" and is referenced via the Excel VLOOKUP function in column G of sheet 1.

x2.jpgx4.JPG

 

 

Copy and paste column G to Notepad and save as a txt file with the extension .scr then run the script in AutoCAD. (Note, it has been stated that you can simply paste the contents of the clipboard into AutoCAD.  This did not work for me but the script file does work.)

 

Here is the data in Notepad:

x5.JPG

 

 

Here are the results in AutoCAD:

x3.JPG

 

lee.minardi
Message 19 of 20
mya_thida_win
in reply to: leeminardi

Thanks a lot. It helps the time savings😍

Message 20 of 20

Hey guys, this has been exactly what I've been trying to find so thanks so much! However, I was wondering what I would need to add to the formula to add further vertically offset labels? I'm very new to AutoCAD, mainly using it for site engineering stuff as opposed to anything design related and want to hopefully learn to develop these myself when I need them. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost