What's wrong with this section of code?

Discussion in 'AutoCAD' started by Casey Roberts, Oct 26, 2004.

  1. I get an error saying too few arguments... anyone able to point out my
    mistake?

    (setq ss (ssget '((0 . "LINE"))))

    (setq cnt 0)
    (repeat (sslength ss)
    (SETQ ENT (SSNAME SS CNT)
    PT1 (CDR (ASSOC 10 (ENTGET ENT)))
    PT2 (CDR (ASSOC 11 (ENTGET ENT)))
    CNT (+ CNT 1)
    dist (* (GETVAR "DIMSCALE") 0.375)
    PA (POLAR PT1 (+ (/ PI 2) (ANGLE PT1 PT2)))
    PB (POLAR PT2 (+ (/ PI 2) (ANGLE PT1 PT2)))
    ) ; end setq

    ); end repeat
     
    Casey Roberts, Oct 26, 2004
    #1
  2. Crap! ... thanks - stupid parenthesis....

    ((((and thanks for the quick reply))))
     
    Casey Roberts, Oct 26, 2004
    #2
  3. Casey Roberts

    Tom Smith Guest

    Crap! ... thanks - stupid parenthesis....

    No, it's the number of arguments. (polar pt ang dist) -- where's your dist?
     
    Tom Smith, Oct 26, 2004
    #3
  4. I know, found the problem as soon as Jason said to look at the POLAR
    command.
     
    Casey Roberts, Oct 26, 2004
    #4
  5. Casey Roberts

    R.K. McSwain Guest

    Another tip...

    Loading this code into the visual lisp editor and running it points you
    to the problem in less than a minute.

    A couple of ways.....

    1) Set a break point and step your way through the code until you run
    into the error

    2) Run the code until the you reach the error and then view the 'error
    trace' window.
     
    R.K. McSwain, Oct 27, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.