Search the Community
Showing results for tags 'ssdel'.
-
Why does ssdel remove entities from other selection sets, and how to get around it?
benhubel posted a topic in AutoLISP, Visual LISP & DCL
I am writing a routine that requires that I remove objects from a selection set while still keeping the original set around. After running into issues, I created a test routine to see how ssdel is operating. I want it to remove selB from selC, while keeping selA and selD untouched to hold the original selection. It is removing selB from all related selection sets though. Why is it doing this, and how can I fix it? (defun c:TD () ;Test Delete (setq selA(ssget)) ;get base selection A (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.- 5 replies
-
- selection sets
- autolisp
-
(and 1 more)
Tagged with: