(setq selB(ssget)) ;get selection B to remove from selection C
(setq selC selA) ;copies selection A and removes selection B to return the difference
(setq selD selA) ;extra variable to test how ssdel works
(setq i 0) ;index
(repeat (sslength selB) ;repeat for each entity in selB
(ssdel (ssname selB i) selC) ;intended to remove selB from selC. It is also removeing selB from selA, which I don't want.
(setq i (1+ i))) ;increment
)
;Functions below are used to test which geometry is contained in which selection set
(defun c:dela () ;delete geometry in selection A
(If(/= nil selA)(command ".erase" selA "")(princ "\n selA is empty. Run TD to initialize"))(princ)) ;if selA contains entities, delete them. If not, display error.
(defun c:delb () ;delete geometry in selection B
(If(/= nil selB)(command ".erase" selB "")(princ "\n selB is empty. Run TD to initialize"))(princ)) ;if selB contains entities, delete them. If not, display error.
(defun c:delc () ;delete geometry in selection C
(If(/= nil selC)(command ".erase" selC "")(princ "\n selC is empty. Run TD to initialize"))(princ)) ;if selC contains entities, delete them. If not, display error.
(defun c:deld () ;delete geometry in selection d
(If(/= nil selD)(command ".erase" selD "")(princ "\n selD is empty. Run TD to initialize"))(princ)) ;if selD contains entities, delete them. If not, display error.
(setq selB (ssget)) ;get selection B to remove from selection C
(setq selC (acet-ss-union (list selA))) ;creates a new selection set and copies selection A
(setq i 0) ;index
(repeat (sslength selB) ;repeat for each entity in selB
(ssdel (ssname selB i) selC) ;removes selB from selC
(setq i (1+ i))) ;increment
)
;Functions below are used to test which geometry is contained in which selection set
(defun c:dela () ;delete geometry in selection A
(If(/= nil selA)(command ".erase" selA "")(princ "\n selA is empty. Run TD to initialize"))(princ)) ;if selA contains entities, delete them. If not, display error.
(defun c:delb () ;delete geometry in selection B
(If(/= nil selB)(command ".erase" selB "")(princ "\n selB is empty. Run TD to initialize"))(princ)) ;if selB contains entities, delete them. If not, display error.
(defun c:delc () ;delete geometry in selection C
(If(/= nil selC)(command ".erase" selC "")(princ "\n selC is empty. Run TD to initialize"))(princ)) ;if selC contains entities, delete them. If not, display error.