Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Delete everything within or outside of a boundary?

15 REPLIES 15
Reply
Message 1 of 16
ArchD
17453 Views, 15 Replies

Delete everything within or outside of a boundary?

Does anyone have a way to delete everything in or outside of a boundary? I was thinking something like an xclip for normal objects. Right now I use extrim, but that only trims whats touching the boundary line and I would like for it to get rid of everything inside or outside of the boundary. No wipeouts either, not what I'm looking for.

Thanks in advance everyone.
Archie Dodge
Applications Expert - Infrastructure Solutions Division
IMAGINiT Technologies
15 REPLIES 15
Message 2 of 16
Anonymous
in reply to: ArchD


Hi,

 

Make a Selection with CP or WP after recovering the
boundary's coordinates (better use a polyline) and then erase the
Selection, in order to remove everything inside the boundary or
use
Select->All->Remove->Selection, in
order to delete everything outside the boundary.

 

HTH


--
Humans are born with a wide
horizon.
As time goes by, the horizon narrows and
narrows, until it
becomes a point of view.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Does
anyone have a way to delete everything in or outside of a boundary? I was
thinking something like an xclip for normal objects. Right now I use extrim,
but that only trims whats touching the boundary line and I would like for it
to get rid of everything inside or outside of the boundary. No wipeouts
either, not what I'm looking for. Thanks in advance
everyone.
Message 3 of 16
Anonymous
in reply to: ArchD


(DEFUN C:ERASEOUT ()
(COMMAND "ZOOM"
"E")
(SETVAR "HIGHLIGHT" 0)
(PRINC "\nTHIS COMMAND ERASES EVERYTHING
OUTSIDE A WINDOW\n")
(PRINC "\nPICK FIRST THEN SECOND POINT OF
WINDOW")
(SETQ PT1 (GETPOINT))
(SETQ PT2 (GETCORNER PT1))
(SETQ OBJS
(SSGET "C" PT1 PT2))
(SETQ W1 (GETVAR "EXTMIN"))
(SETQ W2 (GETVAR
"EXTMAX"))
(COMMAND "ERASE" "C" W1 W2 "R" OBJS "")
(PRINC)
(SETVAR
"HIGHLIGHT" 1)

)

 

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Does
anyone have a way to delete everything in or outside of a boundary? I was
thinking something like an xclip for normal objects. Right now I use extrim,
but that only trims whats touching the boundary line and I would like for it
to get rid of everything inside or outside of the boundary. No wipeouts
either, not what I'm looking for. Thanks in advance
everyone.
Message 4 of 16
Anonymous
in reply to: ArchD

Here's a simplified version of the same, using the "All" option in object selection:

(DEFUN C:ERASEOUT ()
(SETVAR "HIGHLIGHT" 0)
(PRINC "\nTHIS COMMAND ERASES EVERYTHING OUTSIDE A WINDOW\n")
(command "_.erase" "_all" "_remove" "_crossing" pause pause "")
(SETVAR "HIGHLIGHT" 1)
(PRINC)
)

That avoids the need to Zoom to the extents so it will "see" everything, because "All" doesn't care
whether things are visible in the current view, the way "Window" and "Crossing" do. And the
crossing-window option in Erase will supply its own prompts about selecting the corners. No
variables required.

--
Kent Cooper


"andrew" wrote...
(DEFUN C:ERASEOUT ()
(COMMAND "ZOOM" "E")
(SETVAR "HIGHLIGHT" 0)
(PRINC "\nTHIS COMMAND ERASES EVERYTHING OUTSIDE A WINDOW\n")
(PRINC "\nPICK FIRST THEN SECOND POINT OF WINDOW")
(SETQ PT1 (GETPOINT))
(SETQ PT2 (GETCORNER PT1))
(SETQ OBJS (SSGET "C" PT1 PT2))
(SETQ W1 (GETVAR "EXTMIN"))
(SETQ W2 (GETVAR "EXTMAX"))
(COMMAND "ERASE" "C" W1 W2 "R" OBJS "")
(PRINC)
(SETVAR "HIGHLIGHT" 1)
)
....
Message 5 of 16
Anonymous
in reply to: ArchD

Try this called CookieCutter2. It's similar to extrim with the option you asked for,
delete all inside or outside. Read the header comments for more info.

Joe Burke
Message 6 of 16
rkumar
in reply to: ArchD

Hi Joe

Its working fine, Thanks for your post.

with regards

P Rajkumar
Message 7 of 16
Anonymous
in reply to: ArchD

You're welcome.
Message 8 of 16
ArchD
in reply to: ArchD

I couldn't ask for more. The description in the header is nice too, thank you very much.
Archie Dodge
Applications Expert - Infrastructure Solutions Division
IMAGINiT Technologies
Message 9 of 16
Anonymous
in reply to: ArchD

You're welcome.

I spent a lot of time on that routine.

Joe Burke
Message 10 of 16
hamid.akbari
in reply to: Anonymous

this lisp works just for one object.

if I want to select multiple object to erase other objects ,what should I do?

Thanks

Message 11 of 16
Will.neal
in reply to: Anonymous

This is awesome! Thanks!

Message 12 of 16
3dcat
in reply to: Anonymous

Hi Joe,

I downloaded the CookieCutter2 lsp routine - works great! Thanks for posting it : )

Message 13 of 16
JamaL9722060
in reply to: Anonymous

Thank you very much Joe Burke for sharing the lsp file. This is amazing

 

Clip_180.jpgClip_181.jpg

---------------------------
Jamal Numan
Message 14 of 16
steve_davidson
in reply to: Anonymous

that is the goods, thanks so much for sharing.

Message 15 of 16
Eden.Barrera
in reply to: Anonymous

I see I'm a little late to the party but it might help someone.

I was able to use what you gave and modify it to have it without having to pick a window. This works if you use limits for your drawings as I do.

For this to work you need to make sure limits are ON.

Also, the proper limits are set for your choice of the border.

 

(DEFUN C:ERASEOUT ()
(COMMAND "ZOOM"
"E")
(SETVAR "HIGHLIGHT" 0)
(setq pt1 (getvar 'limmin)
        pt2 (getvar 'limmax))
(SETQ OBJS
(SSGET "C" PT1 PT2))
(SETQ W1 (GETVAR "EXTMIN"))
(SETQ W2 (GETVAR
"EXTMAX"))
(COMMAND "ERASE" "C" W1 W2 "R" OBJS "")
(PRINC)
(SETVAR
"HIGHLIGHT" 1)
(COMMAND "ZOOM" "E")
)
Message 16 of 16
mc5fan
in reply to: Eden.Barrera

Thank you. I wrote a lsp-scr combo, using your code as a basis, that just made my job much easier!

Lee M.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost