Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Anonymous
450 Vistas, 3 Respuestas

Error: syntax error

Hi Guys !   I want to run a AutoLISP app in AutoCAD.  I am on a Mac. It is possible to run but then while performing it shows an error message saying: " error: syntax error". 

The code is in the attachments.

 

Please help !

 

maxim_k
en respuesta a: Anonymous

Hi @Anonymous,

The code you attached shows another error, when I try to use it in AutoCAD:
"too few arguments in SETQ: (SETQ P4 ALTURA (GETDIST "\nIndique a altura da viga: "))"
and it is really true:
The statement (SETQ P4 ALTURA (GETDIST "\nIndique a altura da viga: ")) in this routine doesn't assign anything to P4 variable - there should be something between P4 and ALTURA variables: some GET function or some already assigned variable.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Anonymous
en respuesta a: maxim_k

should it work if i insert  (setq p4 (getdist "\nIndique a altura da viga: ")) instead of  (setq p4  altura (getdist "\nIndique a altura da viga: ")) ?

maxim_k
en respuesta a: Anonymous

Yes, if the subsequent part of the code is correct.
But (+ ((angle p1 p2) (angle p2 p1) 90) = 180)) seems to be incorrect, because "= (equal to)" also is a function and its signature is (= numstr [numstr ...]. In your case, you are using it incorrectly.
The syntax of "+" function is also incorrect, it should be (+ [number number ...]), but you have something strange.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community