TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Red Nova on January 10, 2018, 06:24:34 PM

Title: exiting while loop with escape. error omitted?
Post by: Red Nova on January 10, 2018, 06:24:34 PM
Hi.
I bit nooby but I recently noticed that if I force break a while loop with escape the continuation will not go through *error* function.
1. Can you tell me why? ։)
2. What can be a solution?

Here is an example.
I am creating a while loop with a simple calculation that will take a few seconds to run.
Set current color - GREEN
run test command
If we let the command finish we will have same GREEN current color when done.
But if we press escape before while is finished we get RED in current color.

Code: [Select]
(defun c:test ( / i var val *error*)
  (defun *error* ( msg )
    (mapcar 'setvar var val)
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
                 (princ (strcat "\nError: " msg)))
    (vla-endundomark adoc)
    )

  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
 
  (setq var '(clayer cecolor)
        val  (mapcar 'getvar var))

  (setvar "cecolor" "1")
  (setq i 1)
  (while
    (< i 5000000)
    (setq i (1+ i))
    )
  (setvar "cecolor" "2")
  (*error* nil)
  )

Thanks for the feedback.
Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 11, 2018, 02:57:01 AM
Are you using an english version of AutoCAD?
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 11, 2018, 03:12:12 AM
Yes, it's English version. What's the difference?
Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 11, 2018, 03:35:10 AM
Maybe it is not the solution... but in other languages:

"Function cancelled" "console break" "quit / exit abort"   in italian is
"Funzione annullata" "la funzione è stata annullata" "interruzione da tastiera" "esci / continua"
Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 11, 2018, 03:49:59 AM
Code: [Select]
(defun c:test ( / i var val *error*)
  (defun *error* ( msg )
    (print (getvar "cecolor")) (princ " < color on start *error*")
    (mapcar 'setvar var val)
    (print (getvar "cecolor")) (princ " < color after mapcar *error*")
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
                 (princ (strcat "\nError: " msg)))
    (vla-endundomark adoc)
    (print (getvar "cecolor")) (princ " < color after endundomar *error*")
  )
  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (print (getvar "cecolor")) (princ " < color on start test")
  (setq var '(clayer cecolor)
        val  (mapcar 'getvar var))
  (setvar "cecolor" "1")
  (print (getvar "cecolor")) (princ " < color after cecolor 1")
  (setq i 1)
  (while
    (< i 5000000)
    (setq i (1+ i))
  )
  (setvar "cecolor" "2")
  (print (getvar "cecolor")) (princ " < color after cecolor 2")
  (*error* nil)
  (print (getvar "cecolor")) (princ " < color on end test")
)
Code: [Select]
Comando: TEST
"3"  < color on start test
"1"  < color after cecolor 1
"1"  < color on start *error*
"3"  < color after mapcar *error*
Error: Funzione annullata                   <<< ESC
"3"  < color after endundomar *error*

Comando: test
"3"  < color on start test
"1"  < color after cecolor 1
"2"  < color after cecolor 2
"2"  < color on start *error*
"3"  < color after mapcar *error*
"3"  < color after endundomar *error*
"3"  < color on end test" < color on end test"
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 11, 2018, 10:19:36 AM
So when you break while with escape it actually goes through *error* for you?
I got this:

Code: [Select]
Command: TEST
"3"  < color on start test
"1"  < color after cecolor 1
"1"  < color on start *error*Function cancelled      <<< ESC
Command:
Command: *Cancel*

Command: TEST
"1"  < color on start test
"1"  < color after cecolor 1
"2"  < color after cecolor 2
"2"  < color on start *error*
"1"  < color after mapcar *error*
"1"  < color after endundomar *error*
"1"  < color on end test" < color on end test"
Command:

How can this be?  :-o
Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 11, 2018, 10:48:10 AM
So when you break while with escape it actually goes through *error* for you?
Yes.

Try   (while  (< i 50000000)  (setq i (1+ i)))
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 11, 2018, 01:06:09 PM
AutoCAD is broken.  :crazy2:
I use 2017. Which version is yours?

So when you break while with escape it actually goes through *error* for you?
Yes.

Try   (while  (< i 50000000)  (setq i (1+ i)))


Same result.
Code: [Select]
Command: TEST
"3"  < color on start test
"1"  < color after cecolor 1
"1"  < color on start *error*Function cancelled
Command:
Command: *Cancel*
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 11, 2018, 01:41:10 PM
Just tried on 2018 English. Still not working.
Title: Re: exiting while loop with escape. error omitted?
Post by: PKENEWELL on January 11, 2018, 03:27:36 PM
I think I know what your problem is:

Your "var" list is not quoting the system variable names or sending them as strings which is required for (getvar). Try the following instead.

Code: [Select]
(setq var '("clayer" "cecolor"))   
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 11, 2018, 03:52:35 PM
I think I know what your problem is:

Your "var" list is not quoting the system variable names or sending them as strings which is required for (getvar). Try the following instead.

Code: [Select]
(setq var '("clayer" "cecolor"))   

That doesn't help. As you can see from previous posts if I let the code complete (and my code actually finishes with *error*), then *error* will work just fine. But if I escape during while loop then it won't simply go to *error*. Try Code from Marc'Antonio Alessi, I wonder what will you get. Try first letting the code do it's work. Then try to break while with escape.
Title: Re: exiting while loop with escape. error omitted?
Post by: JohnK on January 11, 2018, 04:02:09 PM
If I'm not mistaken, I believe you haven't set the error routine to run properly.

-i.e. See highlighted line.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:MyLisp ( / AweSh0t )
  2.  
  3.   (defun AweSh0t (s / )
  4.     (setq *error* olderr
  5.           olderr  nil)
  6.     (princ) )
  7.   (setq olderr *error* *error* AweSh0t)
  8.  
  9.   (command "_line")
  10.  
  11.   (while (eq (getvar "cmdactive") 1)
  12.          (command PAUSE))
  13. )
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 11, 2018, 05:01:20 PM
If I'm not mistaken, I believe you haven't set the error routine to run properly.

-i.e. See highlighted line.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:MyLisp ( / AweSh0t )
  2.  
  3.   (defun AweSh0t (s / )
  4.     (setq *error* olderr
  5.           olderr  nil)
  6.     (princ) )
  7.   (setq olderr *error* *error* AweSh0t)
  8.  
  9.   (command "_line")
  10.  
  11.   (while (eq (getvar "cmdactive") 1)
  12.          (command PAUSE))
  13. )

John, aren't those simply different approaches to error handling? I am localizing *error* function, you are not.
However, if *error* is not written the right way, why would it work well if you reach it in the end of the code and not if you break "while" loop with escape button?
Title: Re: exiting while loop with escape. error omitted?
Post by: owenwengerd on January 11, 2018, 07:28:36 PM
This:

Command: TEST
"3"  < color on start test
"1"  < color after cecolor 1
"1"  < color on start *error*Function cancelled      <<< ESC
Command:
Command: *Cancel*

... indicates that Escape was pressed twice: once to cancel the command, then again to cancel the error handler.
Title: Re: exiting while loop with escape. error omitted?
Post by: VovKa on January 11, 2018, 07:36:37 PM
Red Nova, mapcar must be removed from *error*
this should work
Code: [Select]
(defun c:test (/ i val *error*)
  (defun *error* (msg)
    (print (getvar "cecolor"))
    (princ " < color on start *error*")
    (foreach v val (setvar (car v) (cdr v)))
    (print (getvar "cecolor"))
    (princ " < color after mapcar *error*")
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
      (princ (strcat "\nError: " msg))
    )
    (vla-endundomark adoc)
    (print (getvar "cecolor"))
    (princ " < color after endundomar *error*")
  )
  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (print (getvar "cecolor"))
  (princ " < color on start test")
  (setq val (mapcar (function (lambda (v) (cons v (getvar v)))) '("clayer" "cecolor")))
  (setvar "cecolor" "1")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 1")
  (setq i 1)
  (while (< i 5000000) (setq i (1+ i)))
  (setvar "cecolor" "2")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 2")
  (*error* nil)
  (print (getvar "cecolor"))
  (princ " < color on end test")
)
Code: [Select]
Command: test

"3"  < color on start test
"1"  < color after cecolor 1
"1"  < color on start *error*
"3"  < color after mapcar *error*
"3"  < color after endundomar *error*
Command:
Command: *Cancel*
Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 12, 2018, 03:32:06 AM
AutoCAD is broken.  :crazy2:
I use 2017. Which version is yours?
Sorry for late (time zone). I have tested on BricsCAD V16 V18 - AutoCAD 2013 2018 same result.
Try this:
Code: [Select]
(defun MyError (msg)
    (print (getvar "cecolor")) (princ " < color on start *error*")
    (mapcar 'setvar var val)
    (print (getvar "cecolor")) (princ " < color after mapcar *error*")
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
                 (princ (strcat "\nError: " msg)))
    (vla-endundomark adoc)
    (print (getvar "cecolor")) (princ " < color after endundomar *error*")
    (setq *error* olderr)
)
(defun c:test ( / i ) ; olderr var val > are globals
  (setq olderr *error*  *error* Myerror)
  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (print (getvar "cecolor")) (princ " < color on start test")
  (setq var '(clayer cecolor)
        val  (mapcar 'getvar var))
  (setvar "cecolor" "1")
  (print (getvar "cecolor")) (princ " < color after cecolor 1")
  (setq i 1)
  (while
    (< i 5000000)
    (setq i (1+ i))
  )
  (setvar "cecolor" "2")
  (print (getvar "cecolor")) (princ " < color after cecolor 2")
  (Myerror nil)
 ; (setq *error* olderr) ; not needed
  (print (getvar "cecolor")) (princ " < color on end test")
)
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 12, 2018, 11:09:16 AM
owenwengerd - I definitely press escape only once.

VovKa - Actually that helped in the beginning. I don't know why, but using foreach instead of mapcar helped for the initial code.
Escaping during test1 I got this:
Quote
Command: TEST1
"3"  < color on start test
"1"  < color after cecolor 1
"1"  < color on start *error*
"3"  < color after variavle reset using foreach *error*
"3"  < color after endundomar *error*
Command:
Command: *Cancel*

Then I tried to add also UCS reset to *error* and it broke again. Note that error worked untill the moment it reached UCS reset part.
Escaping during test1 I got this:
Quote
Command: TEST2
"3"  < color on start test
"1"  < color after cecolor 1ucs
Current ucs name:  *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis] <World>: z
Specify rotation angle about Z axis <90d0'0">: 45
Command:
"UCS rotated"
"1"  < color on start *error*
"3"  < color after variavle reset using foreach *error*Function cancelled
Command: *Cancel*

Here are 2 codes that I used:
Code: [Select]
(defun c:test2 (/ i val *error*)
  (defun *error* (msg)
    (print (getvar "cecolor"))
    (princ " < color on start *error*")
    (foreach v val (setvar (car v) (cdr v)))
    (print (getvar "cecolor"))
    (princ " < color after variavle reset using foreach *error*")
    (command-s "_.ucs" "_w")
    (print "UCS reset *error*")
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
      (princ (strcat "\nError: " msg))
    )
    (vla-endundomark adoc)
    (print (getvar "cecolor"))
    (princ " < color after endundomar *error*")
  )
  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (print (getvar "cecolor"))
  (princ " < color on start test")
  (setq val (mapcar (function (lambda (v) (cons v (getvar v)))) '("clayer" "cecolor")))
  (setvar "cecolor" "1")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 1")
  (command "ucs" "z" "45")
  (print "UCS rotated")
  (setq i 1)
  (while (< i 5000000) (setq i (1+ i)))
  (setvar "cecolor" "2")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 2 (while completed)")
  (*error* nil)
  (print (getvar "cecolor"))
  (princ " < color on end test")
)

(defun c:test1 (/ i val *error*)
  (defun *error* (msg)
    (print (getvar "cecolor"))
    (princ " < color on start *error*")
    (foreach v val (setvar (car v) (cdr v)))
    (print (getvar "cecolor"))
    (princ " < color after variavle reset using foreach *error*")
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
      (princ (strcat "\nError: " msg))
    )
    (vla-endundomark adoc)
    (print (getvar "cecolor"))
    (princ " < color after endundomar *error*")
  )
  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (print (getvar "cecolor"))
  (princ " < color on start test")
  (setq val (mapcar (function (lambda (v) (cons v (getvar v)))) '("clayer" "cecolor")))
  (setvar "cecolor" "1")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 1")
  (setq i 1)
  (while (< i 5000000) (setq i (1+ i)))
  (setvar "cecolor" "2")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 2 (while completed)")
  (*error* nil)
  (print (getvar "cecolor"))
  (princ " < color on end test")
)

Marc'Antonio Alessi
Your version still did not work for me.

Actually can I ask everyone who is reading this topic to test my initial code from post 1 and post what is the outcome for you? I would appreciate if at least some of you do that. I do not understand how this code can work for Marc'Antonio Alessi and not work for me. Your tests would at least be informative to understand if something is wrong on my computers.
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 12, 2018, 01:32:26 PM
Looks like I could get it right now. :idea:
Replaced command method of UCS return in *error* to activeX and that helped.
I still do not understand why using macpar and command-s within *error* function is causing these issues. But at least now it works.
Thank you guys for the support.
Much appreciated :)

The final code
Code: [Select]
(defun c:test (/ i val *error*)
  (defun *error* (msg)
    (print (getvar "cecolor"))
    (princ " < color on start *error*")
    (foreach v val (setvar (car v) (cdr v)))
    (print (getvar "cecolor"))
    (princ " < color after variavle reset using foreach *error*")
    (kb:UCS:NameWorld t)
    (print "UCS reset *error*")
    (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
      (princ (strcat "\nError: " msg))
    )
    (vla-endundomark adoc)
    (print (getvar "cecolor"))
    (princ " < color after endundomar *error*")
  )
  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (print (getvar "cecolor"))
  (princ " < color on start test")
  (setq val (mapcar (function (lambda (v) (cons v (getvar v)))) '("clayer" "cecolor")))
  (setvar "cecolor" "1")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 1")
  (command "ucs" "z" "45")
  (print "UCS rotated")
  (setq i 1)
  (while (< i 5000000) (setq i (1+ i)))
  (setvar "cecolor" "2")
  (print (getvar "cecolor"))
  (princ " < color after cecolor 2 (while completed)")
  (*error* nil)
  (print (getvar "cecolor"))
  (princ " < color on end test")
)

(defun kb:UCS:NameWorld (MakeActive / localUCS)
  (or g:activedoc (setq g:activedoc (vla-get-activedocument (vlax-get-acad-object))))
  (or g:ucss
      (setq g:ucss
             (vla-get-usercoordinatesystems (vla-get-activedocument (vlax-get-acad-object))
             )
      )
  )
  (setq localUCS (vla-add g:ucss
                          (vlax-3d-point '(0.0 0.0 0.0)) ;origin
                          (vlax-3d-point '(1.0 0.0 0.0)) ;x-axis
                          (vlax-3d-point '(0.0 1.0 0.0)) ;y-axis
                          "_WorldUCS"
                 )
  )
  (if MakeActive
    (vla-put-activeucs g:activedoc localUCS)
  )
  localUCS
)
Title: Re: exiting while loop with escape. error omitted?
Post by: kdub_nz on January 12, 2018, 05:21:59 PM
For anyone following up on this :

The kb:UCS:NameWorld comes from https://www.theswamp.org/index.php?topic=8314.0

The variables prefixed with g: are intended to be global scope in the document domain. These variable values are usually set when the document is opened and are intended to hold the 'pointers' to the object tables and collections, not actual dynamic data.

Regarding the *error* function, I believe the function should be declared local to it's containing function ; constructed just as Red Nova has done. I recall reading 'somewhere' in the AutoCAD Visual Lisp documentation that this was the 'correct' way to declare the function, reducing the likelyhood of the global error handler becoming corrupted.
I haven't evaluated the error function content in this case.

Regards,

Title: Re: exiting while loop with escape. error omitted?
Post by: steve.carson on January 12, 2018, 06:47:14 PM
Red Nova, your original code worked fine for me. Civil3D 2016


Steve
Title: Re: exiting while loop with escape. error omitted?
Post by: roy_043 on January 14, 2018, 04:37:53 AM
@ Red Nova:
Maybe you should look at the *push-error-using-command* function.

Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 14, 2018, 12:08:49 PM

@ Red Nova:
Maybe you should look at the *push-error-using-command* function.
...
Actually can I ask everyone who is reading this topic to test my initial code from post 1 and post what is the outcome for you? I would appreciate if at least some of you do that. I do not understand how this code can work for Marc'Antonio Alessi and not work for me. Your tests would at least be informative to understand if something is wrong on my computers.
What do you get with   "
code from post 1 "?
Title: Re: exiting while loop with escape. error omitted?
Post by: Lee Mac on January 14, 2018, 02:16:34 PM
Red Nova, mapcar must be removed from *error*

Why would the use of mapcar result in this behaviour?
Title: Re: exiting while loop with escape. error omitted?
Post by: VovKa on January 14, 2018, 04:50:55 PM
Red Nova, mapcar must be removed from *error*

Why would the use of mapcar result in this behaviour?
it looks like a bug and it is not exactly (and only) mapcar's
i think interpreter's error trapping function is faulty
i thought it was broken only in the old releases (which i use) but now i see it's still present even in v2018
Title: Re: exiting while loop with escape. error omitted?
Post by: Lee Mac on January 14, 2018, 05:45:15 PM
Red Nova, mapcar must be removed from *error*

Why would the use of mapcar result in this behaviour?
it looks like a bug and it is not exactly (and only) mapcar's
i think interpreter's error trapping function is faulty
i thought it was broken only in the old releases (which i use) but now i see it's still present even in v2018

I'm surprised I've not encountered it previously - thanks VovKa.
Title: Re: exiting while loop with escape. error omitted?
Post by: VovKa on January 14, 2018, 06:32:11 PM
I'm surprised I've not encountered it previously - thanks VovKa.
this indicates that *error* function rarely triggers inside your code, and it is good news ;)
Title: Re: exiting while loop with escape. error omitted?
Post by: PKENEWELL on January 16, 2018, 01:11:11 PM
I think I know what your problem is:

Your "var" list is not quoting the system variable names or sending them as strings which is required for (getvar). Try the following instead.

Code: [Select]
(setq var '("clayer" "cecolor"))   

That doesn't help. As you can see from previous posts if I let the code complete (and my code actually finishes with *error*), then *error* will work just fine. But if I escape during while loop then it won't simply go to *error*. Try Code from Marc'Antonio Alessi, I wonder what will you get. Try first letting the code do it's work. Then try to break while with escape.

I tested you code with my change and did not detect a problem. The "cecolor" value was reset properly every time and the *error* function was entered. I commented out the (if) and just printed the error message to be sure it was entering the *error* function.

Code: [Select]
(defun c:test ( / i var val *error*)

  (defun *error* ( msg )
    (mapcar 'setvar var val)
    (if msg (princ (strcat "\nError: " msg)))
;;     (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
;;                  (princ (strcat "\nError: " msg)))
    (vla-endundomark adoc)
  )

  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))

  (setq var '("clayer" "cecolor")
        val  (mapcar 'getvar var))

  (setvar "cecolor" "1")
  (setq i 1)
  (while
    (< i 5000000)
    (setq i (1+ i))
    )
  (setvar "cecolor" "2")
  (*error* nil)
)
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 18, 2018, 09:31:23 AM
I think I know what your problem is:

Your "var" list is not quoting the system variable names or sending them as strings which is required for (getvar). Try the following instead.

Code: [Select]
(setq var '("clayer" "cecolor"))   

That doesn't help. As you can see from previous posts if I let the code complete (and my code actually finishes with *error*), then *error* will work just fine. But if I escape during while loop then it won't simply go to *error*. Try Code from Marc'Antonio Alessi, I wonder what will you get. Try first letting the code do it's work. Then try to break while with escape.

I tested you code with my change and did not detect a problem. The "cecolor" value was reset properly every time and the *error* function was entered. I commented out the (if) and just printed the error message to be sure it was entering the *error* function.

Code: [Select]
(defun c:test ( / i var val *error*)

  (defun *error* ( msg )
    (mapcar 'setvar var val)
    (if msg (princ (strcat "\nError: " msg)))
;;     (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
;;                  (princ (strcat "\nError: " msg)))
    (vla-endundomark adoc)
  )

  (vl-load-com)
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))

  (setq var '("clayer" "cecolor")
        val  (mapcar 'getvar var))

  (setvar "cecolor" "1")
  (setq i 1)
  (while
    (< i 5000000)
    (setq i (1+ i))
    )
  (setvar "cecolor" "2")
  (*error* nil)
)

As it was mentioned by VovKa, probably there is something wrong with my error trapping function, since both mapcar and command-s were not stable. I am not sure why this happens, but I see it on all computers on our network both on 2017 and 2018 AutoCAD. Since everybody use my settings, I think I might have done something to cause that, but who knows what exactly...
And no, your code still didn't work for my case.
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 18, 2018, 09:32:43 AM
Red Nova, your original code worked fine for me. Civil3D 2016


Steve

Thanks for the check. Looks like until now it's just me on this topic to face this issue.
Title: Re: exiting while loop with escape. error omitted?
Post by: Red Nova on January 18, 2018, 09:59:44 AM
@ Red Nova:
Maybe you should look at the *push-error-using-command* function.

Need to look into that. Never tried. Thanks.
Title: Re: exiting while loop with escape. error omitted?
Post by: VovKa on January 18, 2018, 11:29:52 AM
since both mapcar and command-s were not giving stable
not only these two
but also functions which receive lambda-expression as an argument (vl-sort, vl-some ...)
Title: Re: exiting while loop with escape. error omitted?
Post by: Marc'Antonio Alessi on January 18, 2018, 11:50:45 AM
@VovKa: What do you get with   "code from post 1 "?
Title: Re: exiting while loop with escape. error omitted?
Post by: VovKa on January 18, 2018, 02:13:23 PM
@VovKa: What do you get with   "code from post 1 "?
I got the same error as Red Nova