Jump to content

ya no funciona la rutina


Recommended Posts

Posted

Encontré la rutina en la red y funcionaba bien, despues de varios años quise volver a usarla y ya no funciona

(defun c:cs ()
  (setvar "osmode" 0)
  (setvar "osmode" 32)
  ;(setvar "cmddia" 0)

                           (if (= nil estac) (setq estac 0.00) (setq estac (+ estac 20.00)))
                           (setq cad (strcat "Estacion?< " (rtos estac 2 2) ">:"))
                           (setq estacion (getreal cad))

                     (if (/= estacion nil) ;(setq estac (+ 20 estac))
                             (setq estac estacion)
                       )
                           (setq Pref (getpoint "\nPunto de referencia: "))

                       
                          (SETQ pX(CAR pref) pY(CAR (CDR pref)))

                           (SETQ Pto (GETPOINT "\nPunto para cero:"))  
                        
        (while (/= nil PTO) 
                         
                         (SETQ X1(CAR pto) Y1(CAR (CDR pto)))  
 
                         (setq dist (- y1 py))    
                                   (command "-insert" "cero" pto "" "" "" 
                                   (rtos estac 2 3)    
                                   (rtos dist 2 3)   
                                    )

                           (SETQ Pto (GETPOINT "\nNuevo Punto para cero:"))

         )
;(setvar "cmddia" 1)

)

 

Posted

Our new friend complains that this Lisp doesn't work any more, after it worked well years ago.

Posted

con las nuevas variables del sistema de instalación es lo más probable por qué no funciona ahora.

Posted
12 hours ago, GENARO PEREZ CHENG said:

Encontré la rutina en la red y funcionaba bien, despues de varios años quise volver a usarla y ya no funciona

(defun c:cs ()
  (setvar "osmode" 0)
  (setvar "osmode" 32)
  ;(setvar "cmddia" 0)

                           (if (= nil estac) (setq estac 0.00) (setq estac (+ estac 20.00)))
                           (setq cad (strcat "Estacion?< " (rtos estac 2 2) ">:"))
                           (setq estacion (getreal cad))

                     (if (/= estacion nil) ;(setq estac (+ 20 estac))
                             (setq estac estacion)
                       )
                           (setq Pref (getpoint "\nPunto de referencia: "))

                       
                          (SETQ pX(CAR pref) pY(CAR (CDR pref)))

                           (SETQ Pto (GETPOINT "\nPunto para cero:"))  
                        
        (while (/= nil PTO) 
                         
                         (SETQ X1(CAR pto) Y1(CAR (CDR pto)))  
 
                         (setq dist (- y1 py))    
                                   (command "-insert" "cero" pto "" "" "" 
                                   (rtos estac 2 3)    
                                   (rtos dist 2 3)   
                                    )

                           (SETQ Pto (GETPOINT "\nNuevo Punto para cero:"))

         )
;(setvar "cmddia" 1)

)

 

@GENARO PEREZ CHENG  Por favor sube el dwg donde aplicas el lisp y copia la pantalla de texto donde se ve el error.

Posted

 (command "-insert" "cero"~~

 

In this statement, the cero block is inserted with the -insert function,

it won't work if cero is not in the dwg's blocklist.

 

I guess A few years ago you worked on a drawing with a block "cero", and now you're working on a drawing that doesn't have.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...