duanzhuanming Posted April 4, 2014 Share Posted April 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
MSasu Posted April 4, 2014 Share Posted April 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 4, 2014 Share Posted April 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 4, 2014 Share Posted April 4, 2014 (edited) Try this routine and let me know . EDIT: Misunderstood the OP's needs Edited April 4, 2014 by Tharwat Quote Link to comment Share on other sites More sharing options...
duanzhuanming Posted April 4, 2014 Author Share Posted April 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
MSasu Posted April 4, 2014 Share Posted April 4, 2014 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 4, 2014 Share Posted April 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 4, 2014 Share Posted April 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
duanzhuanming Posted April 5, 2014 Author Share Posted April 5, 2014 ^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! Quote Link to comment Share on other sites More sharing options...
Ger Aven Posted December 17, 2022 Share Posted December 17, 2022 copy the comma delimited x,y,z data from the textfile in Autocad type PLINE command then paste in the command Woalah! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.