Jump to content

INTERSECT command for more than two regions?


Recommended Posts

Hey guys!


If I had 3 regions like the picture, I'd like to be able to get the 2 intersecting regions (without doing them separately). Right now, I'm just getting errors :(


Side request--a LISP that uses INTERSECT without deleting the original regions (similar to this lisp for the SUBTRACT command, or this lisp that does it for polylines rather than regions)







Link to comment
Share on other sites

I believe something like this may work.



(defun c:mintersect (/ ss1 curcmdecho curnomutt)
    (defun *error* (errmsg)
         (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
              (princ (strcat "\nError: " errmsg))
         ) ;_ end if
         (setvar 'cmdecho curcmdecho)
         (setvar 'nomutt curnomutt)
         (vla-endundomark adoc)
    ) ;_ end defun
         (setq adoc (vla-get-activedocument (setq acadObject (vlax-get-acad-object))))
    ) ;_ end vla-startundomark
    (setq curcmdecho (getvar 'cmdecho)
          curnomutt  (getvar 'nomutt)
    ) ;_ end setq
    (prompt "\nSelect Regions to create intersection :")
    (setq ss1 (ssget '((0 . "REGION"))))
    (prompt "\nPick points where to create intersections :")
    (setvar 'nomutt 1)
    (setvar 'cmdecho 0)
    (command-s "._-boundary" "_a" "_b" "_n" ss1 "" "_o" "_r" "" pause)
    (command "._erase" ss1 "")
    (*error* "end")
) ;_ end defun

Edited by ronsingh78
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.

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