+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2013
    Posts
    8

    Default Error: too few arguments

    Registered forum members do not see this ad.

    Please help me i am facing a problem of "Error: too few arguments" when i use wtx.lsp for exporting texts to excel.
    Attached Files

  2. #2
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,980

    Default

    too few arguments.....
    Code:
    (close f)

  3. #3
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2013
    Posts
    8

    Default

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

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,125

    Default

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

    Code:
    (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)
    )

  5. #5
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2013
    Posts
    8

    Default

    Thank You very much sir...its working...
    thanks a ton

  6. #6
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,980

    Default

    Quote Originally Posted by arunr_18 View Post
    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

    Code:
    (defun c:wtx()
    (if  (and
               (setq p1 (getpoint "\nFirst corner :"))
               (setq p2 (getcorner p1 "\n: Other corner :"))
               (setq ss (ssget "w" p1 p2 '((0 . "INSERT"))))
               (setq l (sslength ss)  n 0)
               (setq fto (findfile "coords.csv"))
               (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)
                            )
                      (close f));<--- your error fix
                )
          (startapp "Notepad" fto)
          (princ)
    )

  7. #7
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2013
    Posts
    8

    Default

    Thank you sir..

  8. #8
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jul 2013
    Posts
    8

    Default

    Sir can u give me a lisp for preparing Longitudinal section

  9. #9
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,125

    Default

    Quote Originally Posted by arunr_18 View Post
    Thank You very much sir...its working...
    thanks a ton
    You're welcome .

  10. #10
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,980

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by arunr_18 View Post
    Thank you sir..
    Quote Originally Posted by arunr_18 View Post
    Sir can u give me a lisp for preparing Longitudinal section
    Ehh... are your replying to me or Tharwat?

Similar Threads

  1. ; error: too few arguments
    By satishrajdev in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 7th Feb 2013, 12:22 pm
  2. Replies: 3
    Last Post: 13th Nov 2012, 02:43 pm
  3. Arguments
    By The Buzzard in forum AutoLISP, Visual LISP & DCL
    Replies: 23
    Last Post: 24th Mar 2010, 04:29 pm
  4. too many arguments error on lsp anyone know why
    By chelsea1307 in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 17th Jun 2009, 09:34 pm
  5. Too many Arguments
    By Enigma in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 21st Apr 2009, 07:27 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts