TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 on June 30, 2016, 12:08:05 PM

Title: Problem with (princ) function
Post by: Lupo76 on June 30, 2016, 12:08:05 PM
I made a file that takes a long time to process.
So I decided to insert the following line of code:

(princ (strcat "\nObject " N " of "  TOT "."))

It works, but I do not see the text lines during the (while)process, but only at the end.
I feel that this happens because AutoCAD is too busy and therefore does not update the command bar.
Do you have any advice?
Title: Re: Problem with (princ) function
Post by: ChrisCarlson on June 30, 2016, 12:49:01 PM
Can you post your section of routine?

If the princ is outside of the while loop, it will only display once the loop is exited.
Title: Re: Problem with (princ) function
Post by: Lee Mac on June 30, 2016, 02:05:03 PM
If AutoCAD is rendered unresponsive by the OS as a result of the AutoLISP program/expression taking more than 5 seconds to evaluate, no output will be printed to the command-line until the program has completed evaluation. However, there are 'tricks' that one can use to ensure that AutoCAD is not marked as non-responsive by the OS, such as interspersing calls to the DELAY command or GRREAD function within the processing loop.

See this thread (https://www.theswamp.org/index.php?topic=50848.0) for more.
Title: Re: Problem with (princ) function
Post by: rkmcswain on June 30, 2016, 02:53:59 PM
Quote from: Lee Mac
However, there are 'tricks' that one can use to ensure that AutoCAD is not marked as non-responsive by the OS....

Good stuff Lee Mac !
Title: Re: Problem with (princ) function
Post by: Lee Mac on June 30, 2016, 07:08:31 PM
Quote from: Lee Mac
However, there are 'tricks' that one can use to ensure that AutoCAD is not marked as non-responsive by the OS....

Good stuff Lee Mac !

Cheers RK  :-)