Jump to content

Import points in csv file and plot it in polyline on cad


notview

Recommended Posts

Hi guys, I want to import points from csv file of excel and plot it in Polyline on Cad. Instead of plotting points, I want it in (connected) Polyline.

 

From csv file, the arrangement looks like this:

 

Point No. Northing (y-axis) Easting (x-axis) Elevation (z) Description (code)

(col 1) (column 2) (column 3) (column 4) (column 5)

 

 

In cad, after importing through lisp I only want to plot the Northing and Easting in connected-Polyline. Never mind the Elevation and Description.

Link to comment
Share on other sites

  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

  • notview

    8

  • ReMark

    7

  • BIGAL

    5

  • Spatial_Manager

    5

The arrangement in excel/ csv looks likes this:

 

 

1,864838.261,508783.381,0,POST

2,864848.724,508897.649,0,POST

3,864864.713,508987.101,0,STAKE

4,864889.302,509061.846,0,STAKE

Link to comment
Share on other sites

Sometimes I used script but it takes time removing the other column.

 

The output data of my software is in csv file, if possible anybody could help us make a lisp.. importing directly the csv file formatted as shown above and plot the northing & easting in polyline.

Link to comment
Share on other sites

Remove a column? Why make things difficult for yourself? Use the features that come with the program. You do know that you can HIDE a column in Excel don't you?

 

Maybe something in this thread will be of use to you. Look at the entries by "fixo". He is known to visit here occasionally.

 

http://forums.augi.com/showthread.php?121682-excel-data-to-draw-line-in-autocad

Link to comment
Share on other sites

The format above is the exact arrangement of my output data:

 

Pt. No, Y, X, Z, Code

 

But in http://www.cadforum.cz/cadforum_en/qaID.asp?tip=6606, the arrangement is different (Pt,x,y). If you open my output data (csv) file in excel, there are an additional z & Code.

 

Remove/hide the column of this before you can go to notepad. Or you may just copy the three column (pt,x,y), and paste it in new sheet, save it in csv, open in notepad, edit and add polyline to plot in polyline. Using script file is doing something before it will be plotted. Time consumed..

 

If anybody have a brilliant mind, pls. help. I want it simple, import the csv file and plot in polyline.

Link to comment
Share on other sites

For those unfortunate enough to have their data in reverse mathematical mode, i.e. y before x, you must reverse the data before inserting into AutoCAD.

 

With the current example, I would open the .csv file in Excel, copy the second and third columns to a new file. Swop around columns, so the data was in x,y format and save in .csv format.

 

Open this new file in NotePad, and select and copy everything (Ctrl A, and Ctrl C).

 

In AutoCAD, start the command "Polyline", and when the command line is waiting for the first point, paste into the command line.

 

Or you could wait for some kind soul to write a simple lisp for you.

Link to comment
Share on other sites

Notview what you want has been talked about so many times on this forum, what is wanted is a stringing program that autodetects the changing value in the code joining like codes together or just inserting points with a block, this is available commercially you have to pay for it but it will do lots more than just draw plines.

 

30+ years doing this your code can include extra information such as a string number then F1 is fence 1 F2 is fence 2 the two will not join together.

 

Using excel you can achieve a script that will start and stop plines and points etc but it is complicated. You need to double sort on ptnumber and code

 

This is a typical code for our surveys using numerical coding eg 903 string 102 will only join all 903102's not 903101's which will join seperate. 751000 means its a point object code 751 so insert block 751 the 000 implies this

 

SS        ID=      1138, HA=326.2750, VA= 94.0110, SD=  5.763, HT= 1.525, CO=104100
SS        ID=      1139, HA=298.3435, VA= 93.5705, SD=  3.986, HT= 1.525, CO=104100
SS        ID=      1140, HA=311.3631, VA= 96.0854, SD=  2.422, HT= 1.525, CO=104100
SS        ID=      1143, HA=298.3750, VA= 93.0212, SD=  4.326, HT= 1.525, CO=503000
SS        ID=      1144, HA= 28.1306, VA= 91.3321, SD=  9.969, HT= 1.525, CO=751000
SS        ID=      1145, HA= 23.1824, VA= 91.4623, SD= 13.348, HT= 1.525, CO=752000
SS        ID=      1146, HA= 20.3728, VA= 92.0031, SD= 19.159, HT= 1.525, CO=721000
SS        ID=      1147, HA= 85.2732, VA= 92.3109, SD=  4.965, HT= 1.525, CO=721000
SS        ID=      1148, HA= 86.2237, VA= 92.2605, SD=  5.295, HT= 1.525, CO=NAIL000
SS        ID=      1149, HA= 98.1321, VA= 92.3139, SD=  8.832, HT= 1.525, CO=751000
SS        ID=      1150, HA= 92.4425, VA= 91.5830, SD= 22.023, HT= 1.525, CO=903102
SS        ID=      1151, HA= 90.2148, VA= 92.0738, SD= 16.797, HT= 1.525, CO=903102
SS        ID=      1152, HA= 85.5408, VA= 92.3611, SD= 11.402, HT= 1.525, CO=903102
SS        ID=      1153, HA= 84.3822, VA= 92.4619, SD= 10.507, HT= 1.525, CO=903102
SS        ID=      1154, HA= 81.0933, VA= 92.4345, SD=  8.737, HT= 1.525, CO=903102
SS        ID=      1155, HA= 51.3852, VA= 92.2233, SD=  7.706, HT= 1.525, CO=903102
SS        ID=      1156, HA=180.4550, VA= 91.4155, SD= 10.484, HT= 1.525, CO=300001
SS        ID=      1157, HA=183.5817, VA= 87.5507, SD= 11.460, HT= 1.525, CO=102194
SS        ID=      1158, HA=178.4247, VA= 87.4325, SD= 12.319, HT= 1.525, CO=102194
SS        ID=      1159, HA=170.5804, VA= 88.0112, SD= 12.704, HT= 1.525, CO=102194
SS        ID=      1160, HA=162.2836, VA= 88.3050, SD= 13.511, HT= 1.525, CO=102194
SS        ID=      1161, HA=148.1148, VA= 89.0533, SD= 16.001, HT= 1.525, CO=102194
SS        ID=      1162, HA=135.1440, VA= 89.2516, SD= 20.552, HT= 1.525, CO=102194
SS        ID=      1163, HA=127.2348, VA= 89.4314, SD= 25.387, HT= 1.525, CO=102194
SS        ID=      1164, HA=123.0215, VA= 89.5223, SD= 29.916, HT= 1.525, CO=102194
SS        ID=      1165, HA=253.2822, VA= 90.0224, SD= 23.470, HT= 1.525, CO=300001
SS        ID=      1166, HA=254.1136, VA= 89.5357, SD= 24.749, HT= 1.525, CO=307102
SS        ID=      1167, HA=252.2706, VA= 88.5316, SD= 23.329, HT= 1.525, CO=307102
SS        ID=      1168, HA=253.3959, VA= 88.5400, SD= 23.064, HT= 1.525, CO=307102
SS        ID=      1169, HA=255.1958, VA= 89.5412, SD= 24.476, HT= 1.525, CO=307102
SS        ID=      1170, HA=253.3955, VA= 88.5332, SD= 23.063, HT= 1.525, CO=NAIL000
SS        ID=      1171, HA=256.5711, VA= 89.3739, SD= 24.907, HT= 1.525, CO=713000
SS        ID=      1172, HA=263.0058, VA= 89.3420, SD= 25.435, HT= 1.525, CO=721000
SS        ID=      1173, HA=263.4809, VA= 89.3700, SD= 25.317, HT= 1.525, CO=104100
SS        ID=      1174, HA=269.3041, VA= 89.3124, SD= 43.520, HT= 1.525, CO=903101A
SS        ID=      1175, HA=267.2926, VA= 89.3549, SD= 37.330, HT= 1.525, CO=903101A
SS        ID=      1176, HA=265.5644, VA= 89.3654, SD= 32.782, HT= 1.525, CO=903101A
SS        ID=      1177, HA=262.3530, VA= 89.3840, SD= 26.471, HT= 1.525, CO=903101A
SS        ID=      1178, HA=272.1701, VA= 89.4523, SD= 25.465, HT= 1.525, CO=903101A
SS        ID=      1179, HA=283.0708, VA= 90.0043, SD= 25.202, HT= 1.525, CO=903101A
SS        ID=      1180, HA=293.5656, VA= 90.1200, SD= 26.004, HT= 1.525, CO=903101A
SS        ID=      1181, HA=296.3103, VA= 90.2905, SD= 23.156, HT= 1.525, CO=104100
SS        ID=      1182, HA=299.1320, VA= 90.4003, SD= 20.161, HT= 1.525, CO=104100
SS        ID=      1183, HA=288.1154, VA= 90.2128, SD= 19.905, HT= 1.525, CO=104100
SS        ID=      1184, HA=285.3644, VA= 90.1111, SD= 22.691, HT= 1.525, CO=104100
SS        ID=      1185, HA=275.5139, VA= 89.5753, SD= 23.174, HT= 1.525, CO=104100
SS        ID=      1186, HA=274.5844, VA= 89.5709, SD= 21.596, HT= 1.525, CO=104100
SS     

Link to comment
Share on other sites

Sometimes.....:facepalm: I have used Excel and Autocad for a few years and never once even thought of pasting to the command line, I tend to run a macro in Excel to create a script file, but this :thumbsup::rofl::notworthy: Thanks

Link to comment
Share on other sites

BIGAL, thank you for the explanation and information. I just used for meantime excel, copy and paste to cad. I understand how difficult to do that lisp. :)

Link to comment
Share on other sites

I understand how difficult to do that lisp

 

I think that what you are asking for is TOO simple for someone to write a specific lisp for only you. It would not have universal appeal.

 

Perhaps this is an opportunity for you to get started with lisp, and write your own.

Link to comment
Share on other sites

:lol: Hehe.. Since this was talked many times this problem on this forum, I think this not only for me.. looking this lisp. If I could only know this language, may be I can help others and to me.. You are right Eldon, this is an opportunity to me to learn lisp. I believed all this problem have a solution. What I only need is TIME, :) and don't have this time. Thanks, I really challenged!!
Link to comment
Share on other sites

notview did you have a look at the excel example I posted ?

 

I need to work out a method of getting the excel IF to 1st check if the code is the same and then check if it is a point hence creating a point and not a series of joined lines. The reason for using excel is I can easily do a double sort two columns in one go. ptnum&code

Link to comment
Share on other sites

notview did you have a look at the excel example I posted ?

 

I am not sure whether the OP is going to use the requested lisp for stringing in a survey environment, or whether he was just looking for a lisp way of plotting one polyline only. We should have more information.

 

I see BIGAL is pressing ahead with a full stringing lisp - perhaps being overgenerous with his time :shock:

Link to comment
Share on other sites

Overgenouous big word thanks, have a look at this, the code is a bit ugly and could be done a lot better, maybe next would be to write a script file v's cutting and pasting or do a excel link. this is about 5% of what a stringing program would do.

 

The excel has macro1 in it just run

 

pointstest.zip

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