0

Hi my Dearest Friends..

I get this message "; error: no function definition: [DEFINE " when I run the below AutoLisp code in AutoCad, Could please somebody show me what is expecting Autocad?, what does it expect [ Define..?.. how can I do it...

This is the code..

 defun C:DDs(       [define program] 
    (setq a (getstring "Qty? "))
    (setq b (getstring "Lot? "))

        (if (= a b)
           (progn
             (princ "HoHoH ")
           );end progn
           (progn
             (princ "Hihihii")
           );end progn
        );end if

)

Thanks a lot, all the best to all of you...

I tryed to rid of the error message when i run mi autolisp app

Lee Mac
  • 15,615
  • 6
  • 32
  • 80
fevera13
  • 11
  • 1

1 Answers1

1

There are a couple of issues with your code:

  1. You are missing an opening parenthesis before the defun expression:

    (defun c:DDs
    ^---------------------- Here
    
    
  2. [define program] is not valid syntax in AutoLISP - instead, the defun expression should be supplied with a list of arguments and/or local variables, e.g.:

    (defun c:DDs ( / a b )
        ...
    )
    
Lee Mac
  • 15,615
  • 6
  • 32
  • 80