TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: 2e4lite on March 07, 2014, 03:55:43 AM

Title: The selection set of entities combination?
Post by: 2e4lite on March 07, 2014, 03:55:43 AM
   How to Select the entities ,which are the same type、layer、color、Perimeter and area if have in the specified range?
Title: Re: The selection set of entities combination?
Post by: irneb on March 07, 2014, 05:42:42 AM
The type/layer/color can very easily be selected using selection filters. http://www.afralisp.net/autolisp/tutorials/selection-set-filters.php (http://www.afralisp.net/autolisp/tutorials/selection-set-filters.php)

The perimeter and area might be a different matter. You could do a selection first (using filters for the other properties), then step through it and remove those which do not fall within the rage(s). You can obtain the perimeter/area using various methods: just do a google on autolisp perimeter.
Edit: or even on this site:
Unfortunately you can't add custom selection filtering like you can in Revit - i.e. introduce a custom function which the select tool asks if the entity is acceptable before adding it to the selection set. That would have been great, but unfortunately not available in AutoCAD, definitely not in AutoLisp.
Title: Re: The selection set of entities combination?
Post by: CAB on March 07, 2014, 06:22:08 PM
These are very old but may be of some use.
http://www.theswamp.org/index.php?topic=1915.0
Title: Re: The selection set of entities combination?
Post by: 2e4lite on March 09, 2014, 03:26:29 AM
CAB,
   Thanks for your routine,It's good! In this line:(setq ent (car (entsel "\nSelect object to match area & layer."))).  I think it will be more efficient in use,if use ssget to Select object In this line.
Title: Re: The selection set of entities combination?
Post by: CAB on March 09, 2014, 10:48:22 AM
Feel free to modify for your needs.
Enjoy.