Cylis0509 Posted February 18, 2015 Posted February 18, 2015 (edited) Hi, Does anyone know a way to display an alert with no buttons while the LISP is running and then suppress it? I have a very long conversion LISP that does a multitude of things. I would like an alert to pop up at each stage to let the user know what's going on. i.e., While converting plotstyles an alert pops up saying "Converting Plotstyle... Please Wait." then suppress. Then another alert to pop up saying "Converting Layers... Please Wait." then suppress. And so on. I am doing this for two reasons; one to let the user know what is going on and two to keep them from doing anything else while its running. I am a moderate user of LISP and looked into progress bars but just cant seem to get them to work for me. A little over my head. I thought this would be a great and quick alternative. I know I can do it with DCL but I am trying to avoid it if possible. A simple alert with no buttons. Thank you, Cylis0509 Edited February 18, 2015 by Cylis0509 Added more information Quote
Lee Mac Posted February 18, 2015 Posted February 18, 2015 Since AutoLISP & standard DCL do not allow multiple processor threads or modeless dialogs, unfortunately this is not possible - any alert would be modal and would hence interrupt processing until dismissed by the user. Quote
rkmcswain Posted February 18, 2015 Posted February 18, 2015 @LeeMac -- what about in 3rd party apps such as OpenDCL? Quote
Lee Mac Posted February 18, 2015 Posted February 18, 2015 @LeeMac -- what about in 3rd party apps such as OpenDCL? Quite probably possible, however, since I have no experience with such applications, I could not advise. Quote
BIGAL Posted February 19, 2015 Posted February 19, 2015 I am pretty sure I have a progress bar example it must be at home will try to find. Found this though at Forums Autodesk by The_Sator ;; EXAMPLE LISP SHORT VERSION (defun c:test(/ progress) (defun progressbar (a b c d) (cond ((= 0 a) (acet-ui-progress-init d 100) (setq c 0) ) ((= 1 a) (setq c (+ (/ 100.0 b) c)) (acet-ui-progress-safe c) ) ((= 2 a) (acet-ui-progress-done) ) ) c ) (setq repeatvariable 10000) (setq progress (Progressbar 0 repeatvariable progress "Processing:")) ;Create the progress bar, total length is repeatvariable or 10000 (repeat repeatvariable (setq progress (Progressbar 1 repeatvariable progress "")) ;arg (a) is set to 1 and (d) can be blank here ;code to repeat in here ) (Progressbar 2 0 0 "") ;arg(a) is set to 2 to close the progress bar, arg (b), (c) & (d) can be blanks ) Quote
Cylis0509 Posted February 20, 2015 Author Posted February 20, 2015 Thanks Lee Mac, that makes a lot of sense. I found this below but am not sure how to use it. (acet-ui-progress-init "Working:" 10000) (setq i 0 count -1) (repeat 10000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) (acet-ui-progress-done) ) I have played with it but not sure exactly how to use it. Where do I put my code in this. If I have the whole thing at the beginning the progress bar goes to 100 and then my code starts. If I set "(repeat 10000" to 1000 the bar goes to 10% and my code starts. So I then copied, (repeat 10000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) put it halfway between my code and changed "(repeat 10000" to "(repeat 5000". The progress bar appeared, displayed 10%, started my code, then went to 50%, continued my code, and I had another at the end "(repeat 10000" the progress bar went to 100% and finished my code. Worked Good from what I can see. The problem is if I divide it up anymore then that; say by 10, so the progress bar moves by 10% intervals I get the following: Acet-ui-progress was not initialized properly, repeating. I have "(acet-ui-progress-done)" at the very end. I hope I am making sense. My lisp is very long so I didn't want to post the whole thing. Below is a condensed version... (only a very small part of the whole conversion lisp.) ;;function to rename a layer. ;;if old layer exists, and new layer doesn't exist, the old layer is simply renamed. ;;if old layer exists, and new layer is already there, it takes everything on old layer and puts them on new layer. ;;if old layer doesn't exist, it does nothing. (defun renlay (ol nl / ss i ent ) (cond ((and (tblsearch "layer" ol) (not (tblsearch "layer" nl))) (command "._rename" "la" ol nl) ) ((and (tblsearch "layer" ol)(tblsearch "layer" nl)) (command "-LAYMRG" "N" ol "" "N" nl "Y") ) ((not (tblsearch "layer" ol)) (prompt (strcat "\nLayer " ol " not found. ")) ) ) (princ) ) ;;Function (defun c:laytest () ;;; This section is for the Progress Bar! (acet-ui-progress-init "Working:" 10000) (setq i 0 count -1) (repeat 1000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) ;;; Use this templete to add layers: (renlay "ExistingLayer" "LayerMatch") (if (tblsearch "LAYER" "LayerMatch") (progn (command "-layer" "c" "X" "LayerMatch" "lt" "Continuous" "LayerMatch" "ps" "X" "LayerMatch" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "LayerMatch")) "LayerMatchDescription"))) (if (not (tblsearch "LAYER" "_DeleteME")) (progn (command "-layer" "m" "_DeleteME" "c" "12" "_DeleteME" "lt" "DASHED" "_DeleteME" "ps" "G00000(240)" "_DeleteME" "d" "Delete All Items on this layer and delete layer!" "_DeleteME" ""))) (command "-layer" "s" "0" "") (repeat 1000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 2000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 3000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 4000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 5000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 6000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 7000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 8000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 9000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) ;;a lot more layers here... (repeat 10000 (setq i (1+ i)) (setq count (1+ count)) (acet-ui-progress-safe i) ) (renlay "e-bound" "V-PROP-BNDY-GEOM") (if (tblsearch "LAYER" "V-SITE-BOLL-GEOM") (progn (command "-layer" "c" "245" "V-PROP-BNDY-GEOM" "lt" "Continuous" "V-PROP-BNDY-GEOM" "ps" "B125(1)" "V-PROP-BNDY-GEOM" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-GEOM")) "Property: boundary (pq)"))) (renlay "e-bound-bear" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (renlay "e-block-no" "V-PROP-BNDY-TEXT") (if (tblsearch "LAYER" "V-PROP-BNDY-TEXT") (progn (command "-layer" "c" "243" "V-PROP-BNDY-TEXT" "lt" "Continuous" "V-PROP-BNDY-TEXT" "ps" "B070(3)" "V-PROP-BNDY-TEXT" "") (vla-put-description (vlax-ename->vla-object (tblobjname "LAYER" "V-PROP-BNDY-TEXT")) "Property: bearing, distance curve labels"))) (acet-ui-progress-done) (princ "Layers renamed and merged") ) Thank you in advance!!! Quote
Cylis0509 Posted February 20, 2015 Author Posted February 20, 2015 I am pretty sure I have a progress bar example it must be at home will try to find. Found this though at Forums Autodesk by The_Sator ;; EXAMPLE LISP SHORT VERSION (defun c:test(/ progress) (defun progressbar (a b c d) (cond ((= 0 a) (acet-ui-progress-init d 100) (setq c 0) ) ((= 1 a) (setq c (+ (/ 100.0 b) c)) (acet-ui-progress-safe c) ) ((= 2 a) (acet-ui-progress-done) ) ) c ) (setq repeatvariable 10000) (setq progress (Progressbar 0 repeatvariable progress "Processing:")) ;Create the progress bar, total length is repeatvariable or 10000 (repeat repeatvariable (setq progress (Progressbar 1 repeatvariable progress "")) ;arg (a) is set to 1 and (d) can be blank here ;code to repeat in here ) (Progressbar 2 0 0 "") ;arg(a) is set to 2 to close the progress bar, arg (b), (c) & (d) can be blanks ) BIGAL, I am willing to use this if you can show me how? The code I posted to Lee Mac is what Im trying to apply it to. Or the one you mentioned you have at home. Any help or push in the right direction would be greatly appreciated. Thank you!! Quote
Lee Mac Posted February 20, 2015 Posted February 20, 2015 I would suggest the following approach: ;;function to rename a layer. ;;if old layer exists, and new layer doesn't exist, the old layer is simply renamed. ;;if old layer exists, and new layer is already there, it takes everything on old layer and puts them on new layer. ;;if old layer doesn't exist, it does nothing. (defun renlay (ol nl / ss i ent ) (cond ((and (tblsearch "layer" ol) (not (tblsearch "layer" nl))) (command "._rename" "la" ol nl) ) ((and (tblsearch "layer" ol)(tblsearch "layer" nl)) (command "-LAYMRG" "N" ol "" "N" nl "Y") ) ((not (tblsearch "layer" ol)) (prompt (strcat "\nLayer " ol " not found. ")) ) ) (princ) ) ;;Function (defun c:laytest ( / cnt lst obj ) (setq lst '( ;; Old Layer New Layer Colour Linetype Plot Style Description ("e-bound" "V-PROP-BNDY-GEOM" 245 "Continuous" "B125(1)" "Property: boundary (pq)") ("e-bound-bear" "V-PROP-BNDY-TEXT" 243 "Continuous" "B070(3)" "Property: bearing, distance curve labels") ("e-block-no" "V-PROP-BNDY-TEXT" 243 "Continuous" "B070(3)" "Property: bearing, distance curve labels") ;; Add more layers here ) ) ;; DO NOT CHANGE THIS PART: (acet-ui-progress-init "Working: " (length lst)) (setq cnt 0) (foreach itm lst (renlay (car lst) (cadr lst)) (if (setq obj (tblobjname "layer" (cadr lst))) (progn (command "_.-layer" "_c" (nth 2 lst) (cadr lst) "_lt" (nth 3 lst) (cadr lst) "_ps" (nth 4 lst) (cadr lst) "" ) (vla-put-description (vlax-ename->vla-object obj) (nth 5 lst)) ) ) (acet-ui-progress-safe (setq cnt (1+ cnt))) ) (acet-ui-progress-done) (princ "Layers renamed and merged") (princ) ) Quote
Cylis0509 Posted February 20, 2015 Author Posted February 20, 2015 @Lee Mac - Thank you so much, that will work great!! I will play with it. I have a bunch of other things that the conversion is doing and was hoping there was an easier way to incorporate the progress bar. (Easier for me, that is) My entire LISP will: 1.) Convert Plot Styles from ctb to stb 2.) Set the correct .stb 3.) Unlock all layers 4.) Set all layer lineweights to default 5.) Load an .lin file 6.) Add Plotstyles to dictionary 7.) Rename/Merge all layers 8.) Merge all Text Styles 9.) Merge all Dim styles 10.) Purge and Audit the Drawing 11.) Log the use of the LISP 12.) Perform a Save As This LISP is to be used to convert old LDD drawings to CIVIL 3D standards. Maybe when I am all done you would be willing to look at it to help with a progress bar? Maybe when its done I can send it to you through Lee Mac Programming? Thank you for all your help!!! Quote
BIGAL Posted February 20, 2015 Posted February 20, 2015 I had no probs working it out so here is some more explanation. This is certainly something I am going to add to some of my programs so you know its doing something. (acet-ui-progress-init "Working: " (length lst)) the (length lst) is the maximum no of objects in this case the number of layers this is equal to 100% wether its more or less. Using the foreach it loops through the layers (acet-ui-progress-safe (setq cnt (1+ cnt))) the cnt variable is increased by 1 each time you retrieve a layer name so you should see 1% 2% 3% 4% 5% etc appearing it will probably be too fast but bar will move. If you had 200 layers then (length lst) is 200 so the 2nd layer would display 1% the 50th 25%, 100 50%, 199 99% I like you would actually use a bigger number than the (length lst) but rather take each little bit of program you have 12 items so use (acet-ui-progress-init "Working: " 1200) start cnt at 1 as each one is completed reset cnt to item 1 100, item 2 200, you may need a little bit more code to handle say 200 layers so the cnt for that item does not exceed the max range items 3&4 increment to use (fix (/ (length lst) 100)) this would mean cnt goes up by 1 every 2 layers. The end result should be a smooth continuous bar. Quote
Recommended Posts
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.