aleksa32 Posted October 2, 2012 Share Posted October 2, 2012 Hi, I want to know how can I dequote so to say, a reading from a read-line command. To be more specific, I have a TXT file with coordinates and heights, space delimited, and I would like to read the whole line (or parts of it) as not string. expl: ...read-line -> "97451586.021 4869451.235 268.256"... well I wan't to know how can I extract the data between the quotation marks Thanks Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 2, 2012 Share Posted October 2, 2012 What are you going to do with the data once it is read? Quote Link to comment Share on other sites More sharing options...
aleksa32 Posted October 2, 2012 Author Share Posted October 2, 2012 What are you going to do with the data once it is read? Well I was just thinking about that. For now lets just say, I want them in the drawing as points. How would I go about that? Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 2, 2012 Share Posted October 2, 2012 You might use a custom lisp program like Lee Mac's Point Manager. http://lee-mac.com/ptmanager.html Quote Link to comment Share on other sites More sharing options...
aleksa32 Posted October 2, 2012 Author Share Posted October 2, 2012 Thanks man! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 2, 2012 Share Posted October 2, 2012 You're welcome aleksa, glad it helps For space-delimited data, you can also use the following 'shortcut' to interpret the data: (read (strcat "(" <your data> ")")) Quote Link to comment Share on other sites More sharing options...
aleksa32 Posted October 2, 2012 Author Share Posted October 2, 2012 Even better. I was actually looking for something like this! Thanks to all! Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted October 2, 2012 Share Posted October 2, 2012 Also... (setq str "123.123 456.456 789.789") (setq Xcoord (substr str 1 (vl-string-position (ascii " ") str))) (setq Ycoord (substr str (+ (vl-string-position (ascii " ") str) 2) (- (vl-string-position (ascii " ") str nil T) (vl-string-position (ascii " ") str)))) (setq Zcoord (substr str (+ (vl-string-position (ascii " ") str nil T) 2) (- (strlen str) (vl-string-position (ascii " ") str nil T) 1))) (setq point (list (read Xcoord) (read Ycoord) (read Zcoord))) Quote Link to comment Share on other sites More sharing options...
aleksa32 Posted October 2, 2012 Author Share Posted October 2, 2012 E Marko, hvala ti! Bas sad gledam u Help-u taj SUBSTR. Još i ponajbolje rešenje. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted October 2, 2012 Share Posted October 2, 2012 Nema na cemu, Aleksa... Inace ako imas zareze u stringu, samo promeni (ascii " ") u (ascii ",")... Inace zarez je cest delimiter kod CSV fajla (C-Comma Delimited) koji je cesto u upotrebi pri koriscenju transfera podataka ACAD EXCEL... Puno pozdrava i nema na cemu, M.R. Quote Link to comment Share on other sites More sharing options...
mehrdad Posted October 3, 2012 Share Posted October 3, 2012 You might use a custom lisp program like Lee Mac's Point Manager. http://lee-mac.com/ptmanager.html Hi With this program you can get that, Mr. lee me if you can help me with an example. Thank you Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 3, 2012 Share Posted October 3, 2012 HiWith this program you can get that, Mr. lee me if you can help me with an example. Thank you Hi mehrdad, Are you unsure how to use my program? What are you trying to do? Quote Link to comment Share on other sites More sharing options...
mehrdad Posted October 3, 2012 Share Posted October 3, 2012 Hi mehrdad,Are you unsure how to use my program? What are you trying to do? Hi I dont know what the program does and whether I'm at work using PDMS Thank you Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 3, 2012 Share Posted October 3, 2012 HiI dont know what the program does and whether I'm at work using PDMS Thank you The program is designed to run on AutoCAD and other software that enables AutoLISP & Visual LISP functionality (such as Civil3D / MEP etc.), to my knowledge, PDMS doesn't permit the use of AutoLISP or Visual LISP. As for what the program does, please read the description on my site. Lee 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.