ayman_48 Posted May 11, 2016 Posted May 11, 2016 hi everybody i will be thank's if someone help me:- i have poly line with 50 vertex i need lisp to extract this vertex coordinates X,Y into text file Quote
ayman_48 Posted May 11, 2016 Author Posted May 11, 2016 Hi, Is it LWpolyline or 3Dpolyline? 2D polyline Quote
ayman_48 Posted May 11, 2016 Author Posted May 11, 2016 With comma or space separated? with comma please Quote
Tharwat Posted May 11, 2016 Posted May 11, 2016 Last question: what about the precision number of coordinates ? Quote
ayman_48 Posted May 11, 2016 Author Posted May 11, 2016 Last question: what about the precision number of coordinates ? 3 number and i will be thank's for help Quote
Tharwat Posted May 11, 2016 Posted May 11, 2016 Try it and let me know: (defun c:Test (/ ss fl op) ;; Tharwat. 11.May.16 ;; (princ "\nSelect LWpolylines:") (and (setq ss (ssget '((0 . "LWPOLYLINE")))) (setq fl (getfiled "Specify txt file name:" (getvar 'DWGPREFIX) "txt" 1)) (setq op (open fl "w")) (progn ((lambda (i / sn p) (while (setq sn (ssname ss (setq i (1+ i)))) (mapcar '(lambda (x) (and (= (car x) 10) (setq p (cdr x)) (write-line (strcat (rtos (car p) 2 3) "," (rtos (cadr p) 2 3)) op ) ) ) (entget sn) ) ) ) -1 ) (close op) ) ) (princ) ) Quote
ayman_48 Posted May 11, 2016 Author Posted May 11, 2016 Try it and let me know: (defun c:Test (/ ss fl op) ;; Tharwat. 11.May.16 ;; (princ "\nSelect LWpolylines:") (and (setq ss (ssget '((0 . "LWPOLYLINE")))) (setq fl (getfiled "Specify txt file name:" (getvar 'DWGPREFIX) "txt" 1)) (setq op (open fl "w")) (progn ((lambda (i / sn p) (while (setq sn (ssname ss (setq i (1+ i)))) (mapcar '(lambda (x) (and (= (car x) 10) (setq p (cdr x)) (write-line (strcat (rtos (car p) 2 3) "," (rtos (cadr p) 2 3)) op ) ) ) (entget sn) ) ) ) -1 ) (close op) ) ) (princ) ) perfect work man thank's very much جزاك الله خيرا Quote
Tharwat Posted May 11, 2016 Posted May 11, 2016 Tharwat being awesome as always. That's too kind of you to say. 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.