Thanks to all of your posts, I have figured out two different ways to accomplish what I am trying to do.
First off, I want to clarify, that I want to prevent the selection of the xRefs, it seems some of the examples were trying to include them.
So, here are my methods:
Method 1:
Removes xRefs from selection set after finishing the section set.
(defun CW:SSRemoveXrefs (SS / idx en obj)
(vl-load-com)
(setq idx -1)
(repeat (sslength ss)
(setq en (ssname ss (setq idx (1+ idx)))
obj (vlax-ename->vla-object en)
)
(if (vlax-property-available-p obj 'Path)
(progn
(vla-highlight obj :vlax-false)
(ssdel en ss)
(setq idx (1- idx))
)
)
)
SS
)
This has the downside that it still looks like you are selecting xRefs, as you technically are and they are just being removed from the selection set, so I went with a different method.
Method 2
Filters xRefs from the selection set based on name:
(defun CW:SSRemoveXrefs (SS / idx en obj)
(vl-load-com)
(setq idx -1)
(repeat (sslength ss)
(setq en (ssname ss (setq idx (1+ idx)))
obj (vlax-ename->vla-object en)
)
(if (vlax-property-available-p obj 'Path)
(progn
(vla-highlight obj :vlax-false)
(ssdel en ss)
(setq idx (1- idx))
)
)
)
SS
)
(defun C:FD (/ SS xRefs)
(setq xRefs (CW:XREFList))
(if xRefs
(setq Filter (list
'(-4 . "<AND")
'(-4 . "<NOT")
'(0 . "RAY,XLINE,*TEXT")
'(-4 . "NOT>")
'(-4 . "<NOT")
(cons 2 xRefs)
'(-4 . "NOT>")
'(-4 . "AND>")
)
)
(setq Filter (list
'(-4 . "<NOT")
'(0 . "RAY,XLINE,*TEXT")
'(-4 . "NOT>")
)
)
)
(while (not SS)
(setq SS (ssget "_:L" Filter))
)
)
I tried to use some if statements to only use one (setq Filter but it would fail frequently, so this way worked.