Jump to content

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


jbborge

Recommended Posts

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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