jbborge Posted January 14, 2009 Posted January 14, 2009 Hello everyone, just hoping someone could help me with this simple routine or reactor. Just before plotting, i just need an alert box indicating if there is an 'off' layer(s). Would be nice to have options too, like 'Cancel' or 'Proceed to Plot Anyway'...but overall, I just need a visual warning before i plot. Many, many thanks! Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Just to clarify, do you mean layers that are turned off or layers that are set to not plot? Quote
jbborge Posted January 14, 2009 Author Posted January 14, 2009 Just to clarify, do you mean layers that are turned off or layers that are set to not plot? ....just layers that are turned off. Typically, all of our layers are supposed to be turned on right before we exit/save a revised drawing. However, sometimes people just turns off several layers (hatches, text, etc.) to get a better view at what they're doing & then forget to turn those layers back on. Our plot/pdf/dwf request will have missing objects because of that & a simple reactor to alert users could definitely help prevent replots. No plot or frozen layers shouldn't be affected at all. Thx! Quote
ASMI Posted January 14, 2009 Posted January 14, 2009 Simply load it. (defun CreatePlotReactor() (vl-load-com) (if(not plot:reactor) (setq plot:reactor (vlr-command-reactor nil '((:vlr-commandWillStart . PlotAlert)))) ); end if (princ) ); end of CreatePlotReactor (CreatePlotReactor) (defun PlotAlert(Reac Args / lList rStr) (cond ((=(car Args) "PLOT") (vlax-for l (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))) (if(=(vla-get-LayerOn l):vlax-false) (setq lList(cons(vla-get-Name l)lList)) ); end if ); end vlax-for (if lList (progn (setq rStr "==== LAYERS OFF ====") (foreach l(reverse lList) (setq rStr(strcat rStr "\n" l)) ); end foreach (alert rStr) ); end progn ); end if ); end condition ); end cond (princ) ); end of PlotAlert Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Nice one ASMI - class as always. but why do you have to use (car Args)? Quote
jbborge Posted January 14, 2009 Author Posted January 14, 2009 ASMI, I sincerely express my gratitude...thank you sir! Thanks also for trying Lee! You guys have a wonderful day. Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Thanks jbborge - you have a nice day too Quote
ASMI Posted January 14, 2009 Posted January 14, 2009 but why do you have to use (car Args)? Can you stand break-point and look Wach Window for Args value? It will answer for your question. Quote
ASMI Posted January 14, 2009 Posted January 14, 2009 ASMI, I sincerely express my gratitude...thank you sir! Thanks also for trying Lee! You guys have a wonderful day. Thank you for kind words Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Can you stand break-point and look Wach Window for Args value? It will answer for your question. Sorry, you lost me there? Quote
ASMI Posted January 14, 2009 Posted January 14, 2009 Sorry, you lost me there? This is a secret map to find treasures: Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 This is a secret map to find treasures: Haha ASMI you are a legend 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.