View Full Version : Selecting certain objects in a drawing and not torching the rest
tany0070
2007-03-08, 02:26 AM
hi pple, i'll like to ask if anyone knows how to write a lisp program to highlight/select certain objects in a drawing [example in a drawing with lines circles and squares it only selects the circles and not the others, something of this sort] the selected drawings will be used for later object manipulation. Oh and the objects are layered.
thanks
hi pple, i'll like to ask if anyone knows how to write a lisp program to highlight/select certain objects in a drawing [example in a drawing with lines circles and squares it only selects the circles and not the others, something of this sort] the selected drawings will be used for later object manipulation. Oh and the objects are layered.
thanks
Ok, let's try over here too. :lol:
Hi,
The ssget function is probably what you need. Here is an example that selects all circles in the drawing.
(setq ss1 (ssget "X" '((0 . "CIRCLE"))))
There is a lot more information on filtering data with ssget in the Developers Guide, also.
HTH
tany0070
2007-03-08, 02:52 AM
thank you for such a quick reply, may i add on to the question as to how to select say the red colored items shown in the drawing? oh and just for your info, the red lines in the top left quadrant is actually and mirrored image of the lines in the top right quadrant.
thanks
thank you for such a quick reply, may i add on to the question as to how to select say the red colored items shown in the drawing? oh and just for your info, the red lines in the top left quadrant is actually and mirrored image of the lines in the top right quadrant.
thanks
You can add to the filter for group code 62. This will only work for circles that are not colored ByLayer.
thank you for such a quick reply, may i add on to the question as to how to select say the red colored items shown in the drawing? oh and just for your info, the red lines in the top left quadrant is actually and mirrored image of the lines in the top right quadrant.
thanks
Are they all on the same layer, or is the color set otherwise?
If they are all on the same layer:
(setq ss1 (ssget "X" '((8 . "LAYERNAME"))))
will select them. 8 is the dxf code that is associated with the layer.
(Replace LAYERNAME with the layer they are on)
If they are all the same color, but not bylayer:
(setq ss1 (ssget "X" '((62 . 1))))
will work. 62 is the dxf code that is associated with the color.
You can add to the filter for group code 62. This will only work for circles that are not colored ByLayer.
I know, I know. TYPE FASTER! :p
tany0070
2007-03-08, 03:14 AM
Thank you very much [*bow*].
Thank you very much [*bow*].
You're welcome. :)
aaronic_abacus
2007-03-08, 04:50 AM
The standard autocad FILTER command could help as well.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.