satishrajdev Posted February 7, 2013 Share Posted February 7, 2013 Please correct this routine...its showing ; error: too few arguments error (defun c:1 (/ file dta p i) ;POints to TeXT (setq file (open (getfiled "specify output file" "c:/" "csv" 1) "w")) (setq dta (ssget '((0 . "text")))) (repeat (setq i (sslength dta)) (ssname (setq i (1- i))) (write-line (strcat (rtos (car p) 2 3) "," (rtos (cadr p) 2 3) "," (rtos (caddr p) 2 3) ) file) ) (close file) (Princ) ) Thanks a lot Quote Link to comment Share on other sites More sharing options...
pBe Posted February 7, 2013 Share Posted February 7, 2013 [b](setq p (cdr (assoc 10 (entget[/b] (ssname [b]dta[/b] (setq i (1- i))))[b])))[/b] Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted February 7, 2013 Author Share Posted February 7, 2013 thanks a lot pBE..... Problem solved one more thing i want to ask you is,,, I want to put header on each column Just see attached image Quote Link to comment Share on other sites More sharing options...
pBe Posted February 7, 2013 Share Posted February 7, 2013 (defun c:1 (/ file dta p i) ;POints to TeXT [b] (if (and[/b] (setq file (open (getfiled "specify output file" "c:/" "csv" 1) "w")) (setq dta (ssget '((0 . "text"))))[b])[/b] [b] (progn (write-line "EASTING,NORTHING,ELEVATION" file)[/b] (repeat (setq i (sslength dta)) (setq p (cdr (assoc 10 (entget (ssname dta (setq i (1- i))))))) (write-line (strcat (rtos (car p) 2 3) "," (rtos (cadr p) 2 3) "," (rtos (caddr p) 2 3) ) file ) ) (close file) [b]) )[/b] (Princ) ) HTH Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted February 7, 2013 Author Share Posted February 7, 2013 thankx a lot pBE....problem totally solved Quote Link to comment Share on other sites More sharing options...
pBe Posted February 7, 2013 Share Posted February 7, 2013 thankx a lot pBE....problem totally solved Good for you. Keep on coding satishrajdev, you'll get there 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.