Jump to content

; error: too few arguments


satishrajdev

Recommended Posts

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

Link to comment
Share on other sites

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

heas.JPG

Link to comment
Share on other sites

(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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...