Jump to content

Draw polyline from a text file data


duanzhuanming

Recommended Posts

Hi everyone,

I'm looking for a way to draw a polyline from a text file data. Unfortunately, I can not find any way.

In my text file data: there are 3 columns,

1st column is the point name

2nd column is X coordinates

3rd column is Y coordinates

The first row is the coordinate of the first point, but from the second to last rows

are the relative distances between two alternative points.

 

Thanks a lot for your help!

Book1.txt

Link to comment
Share on other sites

You may build a script from your file; below is an example for 4 of your points:

_PLINE
775,0
@20,200
@-595,1
@0,1980

;end of file

 

Save the file with SCR extension and call SCRIPT command to process it. May use Excel (or other worksheet processor) to speed-up the editing.

Link to comment
Share on other sites

Bring it into excel and use the concatenate option to create a new column as MSasu has shown above then very simply just copy the column and paste to the command line.

 

Excel example 23.jpg

Link to comment
Share on other sites

Thank you all for your helps.

I've tried your both ways. but I haven't got it yet.

The first way of using Script command, It didn't works correctly when I added the second polyline

in the same drawing by the same way!

The second way of using routine: It drew only text objects.

P/S: in my data text file, there are sometimes two data regions. it depends on point names "A" or "B"

I want to draw 2 polylines if it happens.

 

Merci d'avance!

Book2.txt

Link to comment
Share on other sites

It didn't works correctly when I added the second polyline

Please clarify, what do you mean by that? Are there some auto Osnap modes active while you run the script? Please try to disable it (press ) and run the script again.

The second way of using routine: It drew only text objects.

I believe Tharwat misread your post; his routine is adding text labels, indeed.

Link to comment
Share on other sites

I believe Tharwat misread your post; his routine is adding text labels, indeed.

 

You're right , I have no time at the moment to look again in OP's request . Thanks

Link to comment
Share on other sites

I actually thought after I posted I bet you have multiple plines you want to do. A simple question is A & B to use the as given start points or do you want to just place the shapes next to each other if so you only need to change the excel code to have a x & y offset.

 

I will redo the excel twice and paste it this time, to me its a real quick soulution.

 

Book1.zip

Link to comment
Share on other sites

^o^. I got it. it works when I disable "Osnap" by pressing F3 as Msasu said!

Thank you all again! it's very kind of you!

Link to comment
Share on other sites

  • 8 years later...

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