Anuncios

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

Error: syntax error

Anonymous

Error: syntax error

Anonymous
No aplicable

Hi Guys !

 

I want to run a AutoLISP app in AutoCAD.  I am on a Mac. It is possible to run but when i perform the "\nIndique o segundo ponto: "

it shows an error message saying: " error: syntax error". 

Here is the code:

(defun c:escada() 
 
    (setq pontoS (getvar "osmode"))
(setq pontoS3d (getvar "3dosmode"))
(setvar "3dosmode" 0))
 
;obter pontos
(setvar "osmode" 1)
(setq p1 (getpoint "\nIndique o ponto inserção: "))
(setq largura (getreal "\nIndique o ponto da largura: "))
(setq espelho (getreal "\nIndique o espelho: "))
(setq cobertor (getreal "\nIndique o cobertor: "))
(setq ndegraus (getint "\n Indique o numero de degraus: " ))
 
  
  (command "ucs" p1 "" )
  (setq p1 (trans p1 0 1))
 (command "box" p1 (list largura cobertor espelho))
 (command "ucs" "world")
 
;repeticao degraus 
 (repeat ndegraus  
  (command "copy" "last" "" p1 (list 0 cobertor espelho)) 
  )
  )
 
Please somebody help me !
0 Me gusta
Responder
365 Vistas
3 Respuestas
Respuestas (3)

maxim_k
Consultant
Consultant
Hi @Anonymous,

>>>>>It is possible to run but when i perform the "\nIndique o segundo ponto: " it shows an error message saying: " error: syntax error".

Sorry, but there is no "\nIndique o segundo ponto: " in the code you provided and it seems to work correctly on my side.

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
0 Me gusta

Anonymous
No aplicable

 I copied the wrong code

Sorry, this is the code:

 

(defun c:escadas()

(setq 2dpontos (getvar "osmode"))
(setq 3dpontos (getvar "3dosmode"))
(setvar "3dosmode" 0))

;indicar pontos
(setvar "osmode" 1)
(setq p1 (getpoint "\nIndique o ponto de inserção: "))
(setq p2 (getpoint "\nIndique o segundo ponto: "))
(setq largura (getdist "\nIndique a largura das escadas: "))


;sobre a viga
(setvar "osmode" 1)
(setq p4 altura (getdist "\nIndique a altura da viga: "))
(setq p5 espessura (getdist "\nIndique a espessura da viga: "))
(setvar "osmode" 0)

(setq medida1 (/ p4 (sin ( angle p1 p2))))
(setq medida2 (+ ((angle p1 p2) (angle p2 p1) 90) = 180))



(command "pline")

p2 (angel p1 p2) (distance ( * cos(angle p4) distance p5 p2)

 


(setvar "3dosmode" 3dpontos)
(setvar "osmode" 2dpontos)
)

 

; converts radians to degrees
(defun RtD (r) (* 180.0 (/ r pi)))

; converts degrees to radians
(defun DtR (d) (* pi (/ d 180.0)))

0 Me gusta

maxim_k
Consultant
Consultant
OK, actually you double posted.
The answer related to that question is here:
https://forums.autodesk.com/t5/autocad-for-mac-forum/error-syntax-error/m-p/9574196#M38591

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
0 Me gusta