sanju2323 Posted August 13, 2015 Posted August 13, 2015 i make population report 600 km along polyline. i need text (under layer structure) along polyline to export length, distance, coordinate and which side text right or left. please download attachment sample file to more detail. Polyline along text distance.LSPFetching info... Required Sample Report.csvFetching info... Sample.dwgFetching info... Quote
sanju2323 Posted August 14, 2015 Author Posted August 14, 2015 Hay, please any thing give lisp or please other separatlly lisp available fine. Quote
Tharwat Posted August 16, 2015 Posted August 16, 2015 Hi , Here is a draft codes for this process , so test this routine and let me know if you need any modification or so. (defun c:test (/ f o s e lst p1 pt ang v l p _mt _t _parse) ;; Tharwat 16.08.2015 ;; (if (and (setq f (getfiled "Select Excel file :" (getvar 'dwgprefix) "csv" 16 ) ) (setq o (open f "r")) (princ "\nSelect LWpolyline :") (setq s (ssget "_+.:S:E" '((0 . "LWPOLYLINE")))) ) (progn (defun _mt (pt str) (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") '(40 . 0.6) '(8 . "point") (cons 10 pt) (cons 1 str) (cons 7 (if (tblsearch "STYLE" "STANDARD") "STANDARD" (getvar 'textstyle) ) ) ) ) ) (defun _t (pt str) (entmakex (list '(0 . "TEXT") '(8 . "Structure") (cons 10 pt) (cons 11 pt) (cons 1 str) (cons 7 (if (tblsearch "STYLE" "ARIAL-N") "ARIAL-N" (getvar 'textstyle) ) ) '(8 . "Structure") '(40 . 2.0) '(50 . 0.0) ;; '(71 . 0) ;; '(72 . 1) ;; '(73 . 2) ) ) ) (defun _parse (string delimiter / pos lst) (while (setq pos (vl-string-search delimiter string 0)) (progn (setq lst (cons (substr string 1 pos) lst)) (setq string (substr string (+ pos 2) (strlen string))) ) ) (if (and string (/= string "")) (setq lst (cons string lst)) ) (setq lst (reverse lst)) ) (setq e (ssname s 0) l (vlax-curve-getdistatpoint e (vlax-curve-getendpoint e)) p (vlax-curve-getstartpoint e) ) (read-line o) (while (setq v (read-line o)) (setq lst (_parse v ",")) (if (< (read (nth 5 lst)) l) (progn (setq pt (vlax-curve-getpointatdist e (read (nth 5 lst))) ang (angle '(0. 0. 0.) (vlax-curve-getfirstderiv e (vlax-curve-getparamatpoint e pt) ) ) p1 (polar pt ((eval (if (eq (last lst) "Right") '+ '- ) ) ang (* pi 1.5) ) (read (nth 4 lst)) ) ) (entmake (list '(0 . "LINE") (cons 10 pt) (cons 11 p1) (cons 8 "perp") ) ) (entmake (list '(0 . "POINT") (cons 10 p1) '(62 . 256) (assoc 8 (entget e)) ) ) (_mt (list (car p1) (cadr p1) (read (nth 3 lst))) (nth 4 lst) ) (_t p1 (car lst)) ) ) ) (close o) ) ) (princ) )(vl-load-com) Quote
sanju2323 Posted August 16, 2015 Author Posted August 16, 2015 Tharwat, Thank you very much to the reply, but i want autocad to csv report. Quote
Tharwat Posted August 16, 2015 Posted August 16, 2015 sanju2323 said: Tharwat, Thank you very much to the reply, but i want autocad to csv report. I make it on the contrary ? Your first post wasn't clear enough to tell that you want it to excel and not from excel to cad. ! Quote
sanju2323 Posted August 16, 2015 Author Posted August 16, 2015 (edited) sorry for confusion, Yes, I want the opposite (answer) lisp. 600km DWG file data already plotted. So I needed to export data as per my attachment csv requirement. Edited August 16, 2015 by sanju2323 Quote
sanju2323 Posted August 22, 2015 Author Posted August 22, 2015 Hi Tharwat, Can you give me code. Need Report From Drawing 2.CSVFetching info... 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.