Search the Community
Showing results for tags 'restored to nil'.
-
How are you. I'm pretty simple with Lisp programming, but develop a routine for my needs I'm having problems with restoring variables; since if the user presses the esc key the variables are not reset at the end of the routine. Can someone help me with error control? I would be very grateful. I attached the routine. ;guarda y establece variables origen________________________________________________________________ (defun s_var (/ gvtho gvomo gvlco) (setq gvtho (getvar "textsize"));Guarda variable text h (setq gvomo (getvar "orthomode"));Guarda variable orthomode (setq gvlco (getvar "clayer"));Guarda variable layer current (setvar 'orthomode 1) (setvar 'tspacefac 1) (setvar 'luprec 2) );endd ;restaura variables de origen (defun r_var () (setvar 'textsize gvtho) (setvar 'orthomode gvomo) (setvar 'clayer gvlco));endd ;Crea y/o establece el layer actual en "_OFFSET Y NIVELES" ____________________________________________ (defun n_lay ( ) (command "._layer" "_M" "_OFFSET Y NIVELES" "_C" "7" "" "") (setvar "clayer" "_OFFSET Y NIVELES"));end ;Preguntar al usuario si el estio tiene Altura_____________________________________________________________________________ (defun q_estion () (initget "Si No") (setq eath (getkword "\nESTILO DE TEXTO ACTUAL TIENE ALTURA? [Si/No] <Si>: "));Estilo actual tiene H (if (= eath "No") (ts) );end if );end ;establece altura de texto cuando el estilo no lo tiene______________________________________________ (defun ts (/ ph) (setq dnht (getdist "\nAltura de Texto: <0.18>: "); Define Nueva H texto dnht (if (null ph) 0.18 ph)) (setvar 'textsize dnht) );end ;if YTN=____________________________________________________________________________________ (defun ytn ( ) (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat "TN= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while );end ;if YG=____________________________________________________________________________________ (defun yg ( ) (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat "G= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while );end ;if YB=____________________________________________________________________________________ (defun yb ( ) (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat "B= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while );end ;if YNC=____________________________________________________________________________________ (defun ync ( ) (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat "NC= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while );end ;if YMC=____________________________________________________________________________________ (defun ymc ( ) (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat "MC= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while );end ;if YOTRO_________________________________________________________________________________ (defun yotro (/ dpry ) (setq dpry (getstring t "\nQue prefijo: <R>: ") dpry (if (null dpry)R dpry)) (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat dpry "= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while );end ;lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll ;if TN=____________________________________________________________________________________ (defun xtn ( ) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat "TN= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while );end ;if G=____________________________________________________________________________________ (defun xg ( ) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat "G= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while );end ;if B=____________________________________________________________________________________ (defun xb ( ) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat "B= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while );end ;if NC=____________________________________________________________________________________ (defun xnc ( ) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat "NC= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while );end ;if NU=____________________________________________________________________________________ (defun xnu ( ) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq v1x (rtos p1x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x "") (command "_.move" "l" "" t1x (cons (- (car t1x) 0.14) (cdr t1x))) );while );end ;if MC=____________________________________________________________________________________ (defun xmc ( ) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat "MC= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while );end ;if XOTRO=____________________________________________________________________________________ (defun xotro (/ dprx ) (setq dprx (getstring t "\nQue prefijo: <R>: ") dprx (if (null dprx) R= dprx)) (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat dprx "= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while );end ;OK_Y___________________________________ (defun C:vy (/ opry pwy p1y v1y m1y t1y) (s_var) (n_lay) (initget "TN R G B NC MC OTRO") (setq opry (getkword "\nPREFIJO EN Y [TN/R/G/B/NC/MC/OTRO] <R>: ")) (q_estion) (if (= opry "TN") (ytn) );end if (if (= opry "G") (yg) );end if (if (= opry "B") (yb) );end if (if (= opry "NC") (ync) );end if (if (= opry "MC") (ymc) );end if (if (= opry "OTRO") (yotro) );end if (while (setq wpy (getpoint "\nQUE PUNTO: ")) (setq p1y (cadr wpy)) ;coordinada en y (setq v1y (rtos p1y 2 2)) (setq m1y (strcat "R= " v1y )) (setq t1y (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1y "j" "ml" "r" "90" "w" "0" m1y "") (command "_.move" "l" "" t1y (cons (- (car t1y) -0.17) (cdr t1y))) );while (r_var) (princ) );end ;OK_XY___________________________________________________ (defun C:vxy (/ oprx wpx p1x p2x v1x v2x m1x m2x t1x t2x) (s_var) (n_lay) (initget "TN NU R G B NC MC OTRO") (setq oprx (getkword "\nOFFEST + PREFIJO EN Y [TN/NU/R/G/B/NC/MC/OTRO] <R=>: ")) (q_estion) (if (= oprx "TN") (xtn) );end if (if (= oprx "R") (xr) );end if (if (= oprx "G") (xg) );end if (if (= oprx "B") (xb) );end if (if (= oprx "NC") (xnc) );end if (if (= oprx "MC") (xmc) );end if (if (= oprx "NU") (xnu) );end if (if (= oprx "OTRO") (xotro) );end if (while (setq wpx (getpoint "\nQUE PUNTO: ")) (setq p1x (car wpx)) ;coordinada en x (setq p2x (cadr wpx)) ;coordinada en y (setq v1x (rtos p1x 2 2)) (setq v2x (rtos p2x 2 2)) (setq m1x (strcat "OFF= " v1x )) (setq m2x (strcat "R= " v2x )) (setq t1x (getpoint "\nDONDE TEXTO: ")) (command "mtext" t1x "j" "ml" "r" "90" "w" "0" m1x m2x "") );while (r_var) (princ) );end
-
Hi everybody, While opening some drawings, AutoCAD shows this error message: ; warning:lost entity restored to NIL Who knows what is it about and how can get rid of that? I appreciate any hep
- 1 reply
-
- lost entity
- ; warning
-
(and 1 more)
Tagged with: