Jump to content

Error: too few arguments


arunr_18

Recommended Posts

Consider this modification on this code for the rest of your routines .

 

(defun c:wtt (/ p1 p2 ss f l a b c d c1 t1 d1 t2 t3 txt)
 (if (and (setq p1 (getpoint "Point :\n:"))
          (setq p2 (getcorner p1 "Other corner :\n:"))
          (setq ss (ssget "_W" p1 p2 '((0 . "*TEXT"))))
          (if (not (setq f (open "d:\\coords.csv" "w")))
            (progn (alert "Can not open Excel file !!") nil)
            t
          )
     )
   (repeat (setq l (sslength ss))
     (setq a   (ssname ss (setq l (1- l)))
           b   (entget a)
           c   (assoc 10 b)
           d   (assoc 1 b)
           c1  (cdr c)
           t1  (rtos (car c1) 2 3)
           d1  (cdr d)
           t2  (rtos (cadr c1) 2 3)
           t3  (rtos (caddr c1) 2 3)
           txt (strcat t1 "," t2 "," t3 "," d1)
     )
     (write-line txt f)
   )
 )
 (if f
   (close f)
 )
 (princ)
)

Link to comment
Share on other sites

Sorry sir but i didnt get u ...wat u want to say..

 

That is the reason why you get the error message .. too few arguments.

 

Consider this

 

(defun c:wtx()
(if  (and
          (setq p1 (getpoint "\nFirst corner :"))
          (setq p2 (getcorner p1 "\n: Other corner :"))
          (setq ss (ssget "w" p1 p2 [b][color="#4169e1"]'((0 . "INSERT")[/color][/b])))
          (setq l (sslength ss)  n 0)
         [b][color="#4169e1"] (setq fto (findfile "coords.csv"))[/color][/b]
          (print l)
          )
           (progn
                 (setq f (open fto "w"))
                 (repeat l
                       (setq a   (ssname ss n)
                             b   (entget a)
                             c   (assoc 10 b)
                             d   (assoc 2 b)
                             c1  (cdr c)
                             t1  (rtos (car c1) 2 3)
                             d1  (cdr d)
                             t2  (rtos (cadr c1) 2 3)
                             t3  (rtos (caddr c1) 2 3)
                             txt (strcat t1 "," t2 "," t3 "," d1)
                             n   (+ n 1)
                             )
                       (write-line txt f)
                       )
                 [b][color="#4169e1"](close f)[/color][/b]);<--- your error fix
           )
     [b](startapp "Notepad" fto)[/b]
     (princ)
)

Link to comment
Share on other sites

Thank you sir..:)

 

Sir can u give me a lisp for preparing Longitudinal section

 

Ehh... are your replying to me or Tharwat?

Link to comment
Share on other sites

Sir can u give me a lisp for preparing Longitudinal section

 

I have no idea about this section , so can you please post an image of that section or a drawing ?

Link to comment
Share on other sites

I have no idea about this section , so can you please post an image of that section or a drawing ?
Yes, it would be good to have DWGs with both before and after, that is, what you start with and what you hope to end up with. Also, arunr_18, you did not really say what your functions were for. Are they intended to prepare the section you mention? BTW, I noticed that the file name is the same in two of them, but is on a different drive for the other. All of them open the file for writing, which means any previous data would be overwritten. Also, in any case WT would overwrite WTT, & vice versa. I mention this just to make sure that is your intention.
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...