TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started 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?
-
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:
- http://www.theswamp.org/index.php?topic=22276.msg268230
- http://www.theswamp.org/index.php?topic=39773.msg451108
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.
-
These are very old but may be of some use.
http://www.theswamp.org/index.php?topic=1915.0
-
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.
-
Feel free to modify for your needs.
Enjoy.