Two main ways to do this.
(defun C:Cexclue2 (/ sel1 sel2)
(setq sel1 (ssget "_X" '((8 . "FNCE,GRADE") (0 . "Line,polyline,lwpolyline"))))
(setq sel2 (ssget "_X" '((8 . "CONC") (0 . "polyline"))))
(foreach ent (mapcar 'cadr (ssnamex sel2))
(ssadd ent sel1)
)
(sssetfirst nil sel1)
(princ)
)
If you using ssget with out "_X" you will need to use the following (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
This selects each selections set and uses the ssget previously selected to create a new selection set.
(defun C:Cexclue2 (/ sel1 sel2)
(setq sel1 (ssget "_X" '((8 . "FNCE,GRADE") (0 . "Line,polyline,lwpolyline"))))
(setq sel2 (ssget "_X" '((8 . "CONC") (0 . "polyline"))))
(command "_.Select" sel1 sel2)
(setq sel1 (ssget "_P"))
(sssetfirst nil sel1)
(princ)
)
I try and stay away from (command usage because i feel it has a greater potential to cause errors.