Jump to content

deleting objects inside or outside of a rectangle


Recommended Posts

My brains gone to bed but I'm still here.

 

Is there a way within AutoCAD to delete all objects within a rectangle (closed polygon) or all objects outside of the rectangle?

 

This then leads on to the question if you can trim to a rectangle or extend to it.

 

I believe I have seen it done somewhere, but it was a long time ago.

 

I know there are LISP routines out there that can do it, but just this once I want to do it the hard way ;-))

 

My problem is I have received a drawing from someone else, but I only need part of it. So before inserting it into my drawing I need to get rid of the stuff I don't need. It's easy enough to define the boundary of the area I need, a rectangle or polygon.

 

Anybody got an idea?

Link to comment
Share on other sites

Re: trimming. Look at the EXTRIM command (Express Tools - command line only) or at Trims.zip at Cad Corner (Canada) that contains three different lisp routines that will trim/erase entities inside or outside of a user defined box. Link:

 

http://www.cadcorner.ca/lisp.php

 

You'll have to scroll down a ways to find it listed.

Link to comment
Share on other sites

1. What about the standard selection method(s)? If you use the window selection method, everything contained inside the window will be selected. If you use the crossing selection method, everything inside and touching the window will be selected.

 

2. Yes, you can trim and extend to a rectangle polyline

 

3. If your selection area is not a rectangle or square, then you can use the "window polygon" or "crossing polygon" with the same effects as described above.

Link to comment
Share on other sites

Short of a lisp routine, you will just have to zoom out and select the objects outside the rectangle with an include or crossing window, then erase. If you have pickadd and pickfirst set to , you can use multiple select windows and/or clicks before erasing. Just don't zoom any of the selected objects off the screen until you erase. For some reason AutoCAD forgets what is selected if it goes off screen. If you select a large amount of objects at once, you may not see the grips highlight, if the count exceeds your grip display limit set on your tools > options > selection tab. Just have the selected objects set to highlight by dash or thicken or both so you will be able to tell what is selected.

 

Yes, you can extend and trim using a rectangle as a 'fence'.

 

(Did it really take me that long to type this? two posts? You guys are fast).

Link to comment
Share on other sites

Rather than select objects and worry about objects off the screen not being selected use, Erase, All, enter, Remove, crossing window inside rectangle, enter.

Link to comment
Share on other sites

Hi guys, thanks for the "express" service.

 

ReMark: Thanks for the tip for Express Tools, I didn't realise there are command line only functions. Now that I've read the help text things are clearer.

The EXTRIM command does the trimming great.

I tried the LISP routine but it bombs out when I issue the command. I'm running a German language version of Civil 2011 on a HP Workstation with a German Windows XP Pro as OS. I don't know if there's something in there that's causing a problem, but I've looked at the LISP code and it seems clean enough. All the English commands are prefixed with an "_", so it should work, but it doesn't. I need a bit of time to look at that.

 

rkmcswain: I've tried using what you suggested, but that's not working 100% either. In a test situation I have a rectangle with various lines and polylines within, without and crossing the rectangle and some are trimmed others not.

 

Dana W: PICKADD and PICKFIRST are set to 1. The tip about zooming selected items off screen is a known problem here too, but thanks anyway as alot of people don't know about it.

 

Thanks guys your suggestions are most welcome and appreciated.

Link to comment
Share on other sites

rkmcswain: I've tried using what you suggested, but that's not working 100% either. In a test situation I have a rectangle with various lines and polylines within, without and crossing the rectangle and some are trimmed others not.

 

Ok, my #1 was answering your second sentence only. (There was no mention of "trimming" objects there.)

Yea, I think EXTRIM should do what you want.

Link to comment
Share on other sites

Rather than select objects and worry about objects off the screen not being selected use, Erase, All, enter, Remove, crossing window inside rectangle, enter.

 

I make it a habit of never using 'erase' and 'all' on the same day, much less in the same sentence.:D

 

You can also trim and extend everything trimmable and extendable at/to the rectangle with crossing windows.

Link to comment
Share on other sites

Forget the rectangle go the whole hog and just trim to any shape polyline including curves, you just use the trim command pick the polyline as a cutter but pick a second offest polyline as a "fence", you can bounce the offeset line further out if required or as I did change the objects inside the trim to a dummy layer then erase all objects not on the dummy layer change layer back again all done. Its the only bit of code I don't have was written for a specific client to trim waffle building construction pads. Like Dana above use the WP option to pick within polygon.

Link to comment
Share on other sites

  • 9 months later...
For some reason AutoCAD forgets what is selected if it goes off screen.

 

Is it really true?

Isn't it fixed in newer versions of ACAD (2010)?

Link to comment
Share on other sites

Is it really true?

Isn't it fixed in newer versions of ACAD (2010)?

I dunno. You got 2010, I don't. Anyway, I have not had that happen to me since the 2007 version.

Link to comment
Share on other sites

Is it really true?

Isn't it fixed in newer versions of ACAD (2010)?

 

That's not a bug. Imagine the carnage that would ensue if a selection window did include off screen objects that inadvertently got selected when the user zooms or pans to a different area of the drawing.

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