Jump to content

Update to "Convert Wipeout to Polyline Region"?

Recommended Posts


(Here is a link to the original post I am referencing)


Hi Guys,


I found this awesome lisp by Renderman/Black Box and I have run it a few times and it worked great those times. Then I tried to run it to convert maybe 20 wipeouts at once and a bunch of them disappeared. I would really like to be able to use this one time once I finish drawing all the wipeouts and not after everyone, but I also don't want to risk some failing to convert and having to redraw a bunch of them.


Does anyone see anything that would cause these errors?


;;; Courtesy of RenderMan, CADTutor.net
;;; Description:
;;; Convert all wipeouts within a given drawing to regions.
;;; Exit function:
(defun WIPEOUT->REGION:Exit  (msg)
 (cond ((not msg))                                                     ; Normal exit
       ((member msg '("Function cancelled" "quit / exit abort")))      ; <esc> or (quit)
       ((princ (strcat "\n  <!>  Error: " msg "  <!> "))))             ; Fatal error, display it
;;; Quit function:
(defun WIPEOUT->REGION:Quit  ()
 (setvar 'cmdecho *oldCmdecho*)
 (setq *oldCmdecho* nil)
 (setq *error* *oldError* *oldError* nil)
 (vla-endundomark *activeDoc*)
;;; Main function:
(defun c:WIPEOUT->REGION  (/ ss)
   (cond (*activeDoc*)
         ((setq *activeDoc*
                 (vla-get-activedocument (vlax-get-acad-object))))))

 ;; Error checking
 (setq *oldError* *error* *error* WIPEOUT->REGION:Exit)
 (setq *oldCmdecho* (getvar 'cmdecho))
 (setvar 'cmdecho 0)

 ;; Main code
 (if (and (setq ss (ssget "_x" '((0 . "WIPEOUT"))))
          (setq ss (ssget "_x")))
   ((lambda (i / e v visList wipList mn mx c)
      (while (setq e (ssname ss (setq i (1+ i))))
        (if (/= "WIPEOUT" (strcase (cdr (assoc 0 (entget e)))))
              (setq v (vlax-ename->vla-object e))
            (setq visList (cons v visList)))
          (setq wipList (cons e wipList))))
      (foreach w  wipList
          (setq v (vlax-ename->vla-object w))
        (setq c
               (mapcar '*
                       (mapcar '+
                               (setq mn (vlax-safearray->list mn))
                               (setq mx (vlax-safearray->list mx)))
                       '(0.5 0.5 0.5)))
        (vl-cmdf "._boundary" c "")
        (vl-cmdf "._matchprop" w (entlast) "")
        (vl-cmdf "._region" "")
        (vla-delete v))
      (foreach o  visList
        (vla-put-visible o :vlax-true)))
   (prompt "\n  <!>  No Wipeouts Detected in Currect Drawing  <!> "))

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now