import csv and place the text along to the polyline

import csv and place the text along to the polyline

jessicatyler0007
Advocate Advocate
1,978 Views
12 Replies
Message 1 of 13

import csv and place the text along to the polyline

jessicatyler0007
Advocate
Advocate

I have a csv attach, import csv and place the text along to the polyline using offset and distance.

0 Likes
Accepted solutions (1)
1,979 Views
12 Replies
Replies (12)
Message 2 of 13

dlanorh
Advisor
Advisor

Please try the attached. I have tested and it works but haven't had time to check thoroughly.

It checks and creates layer "TEXT", colour 1 (red) and sets a text height for the text of 2.0. This can be changed within the lisp (variable ht).

 

 

I am not one of the robots you're looking for

0 Likes
Message 3 of 13

jessicatyler0007
Advocate
Advocate

dlanorh,

Thanks for the lisp, I tested it on several files. It's working properly.

Please make some additional changes as shown in the line below

1) The text justification should be at the middle center.
2) There should be points on the text.
3) Sometimes it happens that if the polyline starts with an odd chainage, then put the chainage manually. Whenever there is no data input, set it to the default starting chainage 0.

0 Likes
Message 4 of 13

dlanorh
Advisor
Advisor
There is no correlation between the Test2.csv and Test2.dwg.
1 and 2 are easy. I don't fully understand 3

I am not one of the robots you're looking for

0 Likes
Message 5 of 13

dlanorh
Advisor
Advisor

Attached is updated lisp that addresses 1 and 2. I will sort 3 (if possible) when I understand what is required.

I am not one of the robots you're looking for

0 Likes
Message 6 of 13

jessicatyler0007
Advocate
Advocate

Please see attached drawing, you will understand, and this time Lisp is showing the error.
An Error : bad argument type: 2D/3D point: nil occurred.

0 Likes
Message 7 of 13

dlanorh
Advisor
Advisor
Re: the error : bad argument type: 2D/3D point: This didn't happen when i tested it on the first CSV, but might if you ran it on test2.csv

I am not one of the robots you're looking for

0 Likes
Message 8 of 13

dlanorh
Advisor
Advisor

OK. The error is occurring because some of the data in test2.csv have chainage values beyond the end of the polyline.

 

The start chainage is 360000.0

 

The polyline is 10068.0 long, so any chainage greater than 370068.0 is causing the routine to error. What do you want it to do in this scenario?

 

Attached is the updated lisp to enable a start chanage to be entered. The lisp currently ignores any data past the end of the polyline.

 

I am not one of the robots you're looking for

0 Likes
Message 9 of 13

jessicatyler0007
Advocate
Advocate

dlanorh,

sorry I did not verify that the length of the polyline is less than the length of the CSV. This is the reason why this error is saying. Please show this error when the polyline length is short., "Please check the length of the polyline".

Thank you for adding new features "Enter staring chainage", Please this feature can also be added to PTR.lsp lisp.

0 Likes
Message 10 of 13

dlanorh
Advisor
Advisor
Accepted solution

Attached are the Lisp and an example "Error" file. I've given the error file the extension "*.err" and it is placed in the same directory as the "*.csv" file that is loaded. The file lists the start chainage, polyline length and the end chainage. There is then a message that the following items are "out of range". It then lists the lines from the csv file that it couldn't process. I hope this is OK. This was the easiest and neatest way of doing things, as it allows you to :

 

1. Remove the "header"  information.

2. Change the file extension to "*.csv"

 

and have a csv file ready to go for the next section.

 

I have added the option to select a text height. There is a default height of 2.0, and just pressing return will accept this.

If there are Items in the csv file it cannot process (re: above) an alert box pops up telling you how many items could not be processed and the full path and file name.

 

I will try to sort PTR to include a start chainage tomorrow.

 

I am not one of the robots you're looking for

Message 11 of 13

jessicatyler0007
Advocate
Advocate

My imagination is even better. I will not even need to create separately CSV .

Thanks a lot.Smiley Happy

0 Likes
Message 12 of 13

Anonymous
Not applicable

Sir,

The lisp isn't working for the attached csv file.

Could you please modify the lisp as per the csv attached.

Layers should be 

1-Points and Sl.no. in "points" layer.

2-Codes in "Code" Layer

3-Z value in "Elevation Layer"

Regards

0 Likes
Message 13 of 13

Anonymous
Not applicable

Sir,

The lisp isn't working for the attached csv file.

Could you please modify the lisp as per the csv attached.

Layers should be 

1-Points and Sl.no. in "points" layer.

2-Codes in "Code" Layer

3-Z value in "Elevation Layer"

Regards

0 Likes