PDA

View Full Version : Selection set using multiple object colors


jsmith.152135
2007-10-31, 05:02 PM
How can I create a single selection set of 5 lwpolylines and hatches of different colors?
I'm using the either options line below to select color 42.

Option A: (setq sel (ssget “X” '((62 . 42)(0 . "lwpolyline,Hatch"))))

Option B: pselect (ssget "x" (list (cons 62 42)(cons 0 "lwpolyline,Hatch")))
so that the selection set was active right away

I want to add colors 50, 134, 221 and 252 to the same selectiom set in option A or B, which ever works!

Thanks in advance

Jim

RobertB
2007-10-31, 08:17 PM
Option B should not be used since you are not saving the selection set to a variable before using it in a command. You will run out of selection set slots using option B. You can use PSelect with a selection set, just make sure is was assigned before the command.

(setq ss (ssget "X" '((0 . "Hatch,LWPolyline") (-4 . "<OR") (62 . 42) (62 . 50) (62 . 134) (62 . 221) (62 . 252) (-4 . "OR>"))))
(command "._PSelect" ss "")
or
(setq ss (ssget "X" (list (cons 0 "Hatch,LWPolyline") (cons -4 "<OR") (cons 62 42) (cons 62 50) (cons 62 134) (cons 62 221) (cons 62 252) (cons -4 "OR>"))))
(command "._PSelect" ss "")

jsmith.152135
2007-11-01, 02:11 PM
Works great, Thanks