Jump to content

Recommended Posts

Posted

Dear all.

 

This is something I tried years ago, without success; let's try again with you wise men (and women): we have many routines which iterate the full database drawing many times, so not to fulfill the console screen (you know, the F2 one ;) with text, we print on it a single variable character as a feedback for the user as everything is up and running, despite the long time usually taken by these routines.

 

Problem rely in the console's character buffer, as every (princ "[char]") IS NOT visualized till the buffer fills, so appearing sudden chunks of characters after long silence lapses, or when the routine ends.

 

I've tried (prin? ..) (prompt ..) and (write-char ..) without success. Ideas?

 

By the way, would be nice to find a solution pre-VisualLisp compatible (but not mandatory ;)

 

Regards

Posted

While iteration you could use (acet-ui-progress*) functions to visualize processing of iterations - you have to implement those functions inside your lisp(s)... Try google-ing for "ACET-UI-PROGRESS" to get more info how to do it...

Posted

Thanks a lot; it looks like de PRO option, but I promise to try to implement it...

 

 

Nevertheless, would be nice to find something like (flush-what-ever ..) that could be added to our old routines effort-less... :)

Posted

I think I understand.

 

I use this for a visual progress display since A2K ( this is when visual was incorporated into autolisp whether you wanted it or not )

 

[b][color=BLACK]([/color][/b]defun c:vprog [b][color=FUCHSIA]([/color][/b]/ ss i en ed la[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
      [b][color=NAVY]([/color][/b]setq i 0[b][color=NAVY])[/color][/b]
      [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss i[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
             [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\t\t\r"[/color][b][color=MAROON])[/color][/b]
             [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b]
             [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b]
                   la [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 8 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
             [b][color=MAROON]([/color][/b]setq i [b][color=GREEN]([/color][/b]1+ i[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b]

 

Sometimes a (princ) was required as the else statement in order to display.

 

This can be modified to work with tables as well

 

-David

Posted

I would go the same way as Marko, you can make it a defun so call it for multiple steps, we have something that does 5 steps so useful to see that something is happening.

 

; This is example code
(setq  doc (vla-get-activedocument (vlax-get-acad-object))) ; open database
(setq allblocks (vla-get-blocks doc)) ; get all the blocks in dwg
(setq numinc (/ 100.0 (vla-get-count allblocks))) ; divide num of blocks as ratio of 100%
(setq num 0.0)

(acet-ui-progress-init "Block to bylayer" 100); heading - interval length heading could  be a variable
(vlax-for block allblocks 
(acet-ui-progress-safe (setq num (+ num numinc))); update progressbar
(command "delay" "100") ; dummy line as progress bar will just flash remove if doing lots of stuff
) ;_ end of vlax-for 
(acet-ui-progress-done); dismiss progressbar
(command "regen") ; remove progress bar

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...