Jump to content

...simple routine to notify me if any off layers before plotting


Recommended Posts

Posted

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!

Posted

Just to clarify, do you mean layers that are turned off or layers that are set to not plot?

Posted
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!

Posted

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

Posted

Nice one ASMI - class as always.

 

but why do you have to use (car Args)?

Posted

ASMI, I sincerely express my gratitude...thank you sir!

Thanks also for trying Lee! You guys have a wonderful day.

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

Posted
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 :)

Posted
Can you stand break-point and look Wach Window for Args value? It will answer for your question.

 

Sorry, you lost me there?

Posted
Sorry, you lost me there?

 

This is a secret map to find treasures:

BPoint.jpg

Posted
This is a secret map to find treasures:

 

Haha ASMI you are a legend :lol:

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