Bª™ªN1534592500 Posted June 27, 2012 Posted June 27, 2012 Hi, I am newbie in creating AutoLISP. Is is possible to write series of texts for a given sets of coordinates? I attached a tab delimited textfile wherein my data are tabulated. First column data are the X coordinates, then at 2nd column are the Y coordinates and the 3rd column are the text to be written on these coordinates. Please help. Regards ExampleData.txt Quote
Lee Mac Posted June 27, 2012 Posted June 27, 2012 Try something simple like: (defun c:txtatpt ( / f p x y ) (if (and (setq f (getfiled "" "" "txt" 16)) (setq f (open f "r")) ) (progn (while (setq n (read-line f)) (if (and (setq p (vl-string-search "\t" n)) (setq x (distof (substr n 1 p))) (setq p (vl-string-search "\t" (setq n (substr n (+ p 2))))) (setq y (distof (substr n 1 p))) ) (entmake (list '(0 . "TEXT") (list 10 x y 0.0) (cons 1 (substr n (+ p 2))) (cons 40 (getvar 'textsize)) ) ) ) ) (close f) ) ) (princ) ) Quote
Bª™ªN1534592500 Posted June 28, 2012 Author Posted June 28, 2012 Thanks Lee Mac, that works perfectly. Problem solved. Quote
Lee Mac Posted June 28, 2012 Posted June 28, 2012 You're welcome Bª™ªN; if you have any questions about the code, just ask Quote
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.