VLIDE *error* issue

VLIDE *error* issue

ВeekeeCZ
Consultant Consultant
592 Views
6 Replies
Message 1 of 7

VLIDE *error* issue

ВeekeeCZ
Consultant
Consultant

Problem: If the routine falls into an *error* function, it is unable to perform certain functions (eg. mapcar) from it.

Everything is fine until running the VLIDE. But just a plain start of VLIDE, doing nothing and exit - that's when the problem starts. The entire AutoCAD, new drawing does not fix it, only restart does. Don't know what it caused... but it's a few days happening.

 

Attached is a simple test - CMDECHO settings. *error* is unable to execute the mapcar. I don't know exactly what other functions... reactors are also a problem, on the contrary, for example, the vla-endundomark is ok.

Video from the CMDECHO test: HERE 

No reactors nor other routines loaded while tested.

 

If anyone has any ideas other than C3D reinstall 🙂

It's  C3D 2022/W10. No recent win updates afaik.

TIA

0 Likes
593 Views
6 Replies
Replies (6)
Message 2 of 7

ronjonp
Mentor
Mentor

@ВeekeeCZ  Your echotest worked fine for me but I'm running vanilla 2023 AutoCAD.

0 Likes
Message 3 of 7

ВeekeeCZ
Consultant
Consultant

@ronjonp 

 

thanks for trying.

I would not expect anything else. It worked here too until last week. Not version related.

Something has broken here and I have no idea what. And it's a weird problem... I guess I was just hoping that someone who could see a little more under the hood might have some tips on how to fix it. thx

0 Likes
Message 4 of 7

kpblc2000
Advisor
Advisor

Why not to redefine *error*?

 

(vl-load-com)

(defun c:undotest (/ adoc res)
  (if (= (type (setq res (vl-catch-all-apply
                           (function (lambda () (initget "Yes No _ Y N") (getkword "\nPress Esc [Yes/No] : ")))
                         ) ;_ end of vl-catch-all-apply
               ) ;_ end of setq
         ) ;_ end of type
         'str
      ) ;_ end of =
    (progn
      (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
      (alert (strcat "You pressed " res))
      (vla-endundomark adoc)
    ) ;_ end of progn
  ) ;_ end of if
  (princ)
) ;_ end of defun

 

 

 

(defun c:echotest (/ sysvars adoc res)
  (if (= (type (setq res (vl-catch-all-apply
                           (function (lambda () (initget "Yes No _ Y N") (getkword "\nPress Esc [Yes/No] : ")))
                         ) ;_ end of vl-catch-all-apply
               ) ;_ end of setq
         ) ;_ end of type
         'str
      ) ;_ end of =
    (progn
      (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
      (setq sysvars (mapcar (function (lambda (x / temp)
                                        (setq temp (getvar (car x)))
                                        (if (cdr x)
                                          (setvar (car x) (cdr x))
                                        ) ;_ end of if
                                        (cons (car x) temp)
                                      ) ;_ end of lambda
                            ) ;_ end of function
                            '(("cmdecho" . 0)
                              ("menuecho" . 0)
                              ("nomutt" . 1)
                              ("clayer")
                             )
                    ) ;_ end of mapcar
      ) ;_ end of setq
      (alert (strcat "You pressed " res))
      (foreach item sysvars
        (setvar (car item) (cdr item))
      ) ;_ end of foreach
      (vla-endundomark adoc)
    ) ;_ end of progn
  ) ;_ end of if
  (princ)
) ;_ end of defun

 

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.


Алексей Кулик aka kpblc | Aleksei Kulik aka kpblc Facebook | LinkedIn
autolisp.ru
Техническая поддержка программистов Autodesk в СНГ
Библиотека пользовательских lisp-функций | Custom Lisp-function library

0 Likes
Message 5 of 7

ВeekeeCZ
Consultant
Consultant

Thank you. I am familiar with this approach and I use it if I find it convenient. But for this case... it's not suitable.

I would love to fix the VLIDE if possible. 

 

Currently, my workaround is simply not running VLIDE from the production drawing.

0 Likes
Message 6 of 7

kpblc2000
Advisor
Advisor

I prefer not to redefine *error* function. At AA / MEP / etc there could be too many code.

I wrote some articles about *error* function and why I do not change it (if you can translate text from russian: https://autolisp.ru/2009/09/13/error-catch/ ; https://autolisp.ru/2016/01/11/undo-error-acad/ )

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.


Алексей Кулик aka kpblc | Aleksei Kulik aka kpblc Facebook | LinkedIn
autolisp.ru
Техническая поддержка программистов Autodesk в СНГ
Библиотека пользовательских lisp-функций | Custom Lisp-function library

0 Likes
Message 7 of 7

ВeekeeCZ
Consultant
Consultant

Thanks.

0 Likes