<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to merge (add) 2 selection sets? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405658#M158448</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp; I have been trying to use the method you suggested but cannot feed the selection set to the OVERKILL command. Any Idea where I am going wrong?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(command "select" ss1 ss2 ss3 ss4 ss5 ss6 ss7 ""); combine all selection sets for the overkill command
(setq ssAll (ssget "p" ""))
;
(command "-overkill" ssAll "" "I" "none" "O" "0.001" "P" "no" "T" "yes" "E" "yes" "A" "yes" "D")
;&lt;/LI-CODE&gt;&lt;P&gt;I keep getting this error.&lt;/P&gt;&lt;P&gt;"Command: ; error: bad point argument" after the selection set. I can see all seven selection sets being added but it fails after that and I don't know if "ssAll" is being created or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example none of the selection sets are empty but there will be a possibility that they might be empty. I need to write the selection set addition so that it will proceed if any of the seven sets are empty or missing. I got my routine to work on a small simple test drawing but it will not work on a project drawing. It is definitly failing before it loads the OVERKILL command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2020 23:47:18 GMT</pubDate>
    <dc:creator>cschnarr</dc:creator>
    <dc:date>2020-03-27T23:47:18Z</dc:date>
    <item>
      <title>How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874189#M158441</link>
      <description>Let's say I have two selection sets...&lt;BR /&gt;
&lt;BR /&gt;
(setq e1 (ssget))&lt;BR /&gt;
(setq e2 (ssget))&lt;BR /&gt;
&lt;BR /&gt;
How do I merge or add them into one?&lt;BR /&gt;
&lt;BR /&gt;
i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Steve</description>
      <pubDate>Tue, 02 May 2000 23:42:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874189#M158441</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-02T23:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874190#M158442</link>
      <description>(setq ss1 (ssget)&lt;BR /&gt;
        ss2 (ssget)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
;; Other code here, perhaps...&lt;BR /&gt;
&lt;BR /&gt;
(setq ss3 ss1&lt;BR /&gt;
        n (sslength ss2)&lt;BR /&gt;
)&lt;BR /&gt;
(while (&amp;gt; n 0)&lt;BR /&gt;
  (setq n (1- n)&lt;BR /&gt;
          ss3 (ssadd (ssname ss2 n) ss3)&lt;BR /&gt;
  )&lt;BR /&gt;
)&lt;BR /&gt;
___&lt;BR /&gt;
"Steve" &lt;NGR&gt; wrote in message&lt;BR /&gt;
news:ef04955.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; Let's say I have two selection sets...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (setq e1 (ssget))&lt;BR /&gt;
&amp;gt; (setq e2 (ssget))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; How do I merge or add them into one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Steve&lt;BR /&gt;
&amp;gt;&lt;/NGR&gt;</description>
      <pubDate>Wed, 03 May 2000 00:22:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874190#M158442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-03T00:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874191#M158443</link>
      <description>If you have A2k, this is how you can use Express Tools ACETUTIL.FAS funtion ACET-SS-UNION:&lt;BR /&gt;
(acet-ss-union (list ss1 ss2))&lt;BR /&gt;
&lt;BR /&gt;
or&lt;BR /&gt;
&lt;BR /&gt;
;;; Example: (ss-union-multiple (list ss1 ss2 ss3))&lt;BR /&gt;
(defun ss-union-multiple (ss)&lt;BR /&gt;
  (mapcar&lt;BR /&gt;
    '(lambda (x / c)&lt;BR /&gt;
      (setq c 0)&lt;BR /&gt;
      (repeat (sslength x)&lt;BR /&gt;
        (ssadd (ssname x c) (car ss))&lt;BR /&gt;
        (setq c (1+ c))&lt;BR /&gt;
      )&lt;BR /&gt;
    )&lt;BR /&gt;
 (cdr ss)&lt;BR /&gt;
  )&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
or&lt;BR /&gt;
&lt;BR /&gt;
;;; Example: (ss-union-2 ss1 ss2)&lt;BR /&gt;
(defun ss-union-2 (ss1 ss2 / c)&lt;BR /&gt;
  (setq c 0)&lt;BR /&gt;
  (repeat (sslength ss2)&lt;BR /&gt;
    (ssadd (ssname ss2 c) ss1)&lt;BR /&gt;
    (setq c (1+ c))&lt;BR /&gt;
  )&lt;BR /&gt;
  ss1&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Best regards: Jimmy B&lt;BR /&gt;
CAD coordinator at Emtunga International AB&lt;BR /&gt;
http://hem.fyristorg.com/cadman/&lt;BR /&gt;
www.emtunga.com&lt;BR /&gt;
Steve &lt;NGR&gt; skrev i diskussionsgruppsmeddelandet:ef04955.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; Let's say I have two selection sets...&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; (setq e1 (ssget))&lt;BR /&gt;
&amp;gt; (setq e2 (ssget))&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; How do I merge or add them into one?&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Steve&lt;BR /&gt;
&amp;gt;&lt;/NGR&gt;</description>
      <pubDate>Wed, 03 May 2000 01:19:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874191#M158443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-03T01:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874192#M158444</link>
      <description>You could use the (SSMAP) function posted in Reini Urban's AutoLISP FAQ as an aid:&lt;BR /&gt;
&lt;BR /&gt;
(defun SSMAP (fun ss / n)&lt;BR /&gt;
  (if (= 'PICKSET (type ss))&lt;BR /&gt;
    (repeat (setq n (sslength ss))&lt;BR /&gt;
      (apply fun (list (ssname ss (setq n (1- n)))))&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
(ssmap) is used to process a function on each ename in a selection set,&lt;BR /&gt;
so you could do this:&lt;BR /&gt;
&lt;BR /&gt;
(setq ss1 (ssget))&lt;BR /&gt;
(set1 ss2 (ssget))&lt;BR /&gt;
&lt;BR /&gt;
(ssmap&lt;BR /&gt;
 '(lambda (e)&lt;BR /&gt;
    (ssadd e ss2)&lt;BR /&gt;
  )&lt;BR /&gt;
  ss1&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
In this case, ss2 returns the union selection set.&lt;BR /&gt;
&lt;BR /&gt;
Matt&lt;BR /&gt;
stachoni@bellatlantic.net&lt;BR /&gt;
&lt;BR /&gt;
On Tue, 2 May 2000 23:42:43 +0000, "Steve" &lt;NGR&gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;Let's say I have two selection sets...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;(setq e1 (ssget))&lt;BR /&gt;
&amp;gt;(setq e2 (ssget))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;How do I merge or add them into one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Thanks,&lt;BR /&gt;
&amp;gt;Steve&lt;/NGR&gt;</description>
      <pubDate>Wed, 03 May 2000 02:19:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874192#M158444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-03T02:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874193#M158445</link>
      <description>Pass this function a list containing all the selection sets you want to add.&lt;BR /&gt;
The first one in the list will receive all entities from the second and&lt;BR /&gt;
remaining sets. If you don't want any of your sets modified, be sure to make&lt;BR /&gt;
the first set in the list an empty one. The function returns an integer&lt;BR /&gt;
indicating the number of entities in the modified set.&lt;BR /&gt;
&lt;BR /&gt;
(defun ssunion (sslist)&lt;BR /&gt;
  (mapcar '(lambda (x / c)&lt;BR /&gt;
      (setq c -1)&lt;BR /&gt;
      (repeat (sslength x)&lt;BR /&gt;
        (ssadd (ssname x (setq c (1+ c)) (car sslist)))&lt;BR /&gt;
      )&lt;BR /&gt;
    )&lt;BR /&gt;
   (cdr sslist)&lt;BR /&gt;
  )&lt;BR /&gt;
  (sslength (car sslist))&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Visit me at http://www2.stonemedia.com/franko&lt;BR /&gt;
"Steve" &lt;NGR&gt; wrote in message&lt;BR /&gt;
news:ef04955.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; Let's say I have two selection sets...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (setq e1 (ssget))&lt;BR /&gt;
&amp;gt; (setq e2 (ssget))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; How do I merge or add them into one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Steve&lt;BR /&gt;
&amp;gt;&lt;/NGR&gt;</description>
      <pubDate>Wed, 03 May 2000 03:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874193#M158445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-03T03:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874194#M158446</link>
      <description>My approach is to cycle thru the smaller of the two selection sets, adding it's members to the&lt;BR /&gt;
larger selection set.  I believe this is faster.&lt;BR /&gt;
&lt;BR /&gt;
(defun ssunion (ss1 ss2 / n1 n2 i)&lt;BR /&gt;
  (setq i -1)&lt;BR /&gt;
  (if (&amp;lt; (setq n1 (sslength ss1)) (setq n2 (sslength ss2)))&lt;BR /&gt;
    (repeat n1 (ssadd (ssname ss1 (setq i (1+ i))) ss2))&lt;BR /&gt;
    (repeat n2 (ssadd (ssname ss2 (setq i (1+ i))) ss1))&lt;BR /&gt;
  )&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
Usage:  (setq ss (ssunion ss1 ss2))&lt;BR /&gt;
&lt;BR /&gt;
________________________________&lt;BR /&gt;
&lt;BR /&gt;
puckettm@bantrel.com&lt;BR /&gt;
&amp;gt; Not &amp;lt; an AutoDESK classroom monitor&lt;BR /&gt;
Imagination makes all things possible&lt;BR /&gt;
________________________________&lt;BR /&gt;
&lt;BR /&gt;
Steve wrote in message ...&lt;BR /&gt;
Let's say I have two selection sets...&lt;BR /&gt;
&lt;BR /&gt;
(setq e1 (ssget))&lt;BR /&gt;
(setq e2 (ssget))&lt;BR /&gt;
&lt;BR /&gt;
How do I merge or add them into one?&lt;BR /&gt;
&lt;BR /&gt;
i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Steve</description>
      <pubDate>Wed, 03 May 2000 14:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874194#M158446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-03T14:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874195#M158447</link>
      <description>Okay, I'll throw my two cents in:&lt;BR /&gt;
&lt;BR /&gt;
(setq set1 (ssget))&lt;BR /&gt;
(setq set2 (ssget))&lt;BR /&gt;
&lt;BR /&gt;
(command "select" set1 set2 "")&lt;BR /&gt;
(setq set3 (ssget "p"))&lt;BR /&gt;
&lt;BR /&gt;
Steve &lt;NGR&gt; wrote in message&lt;BR /&gt;
news:ef04955.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; Let's say I have two selection sets...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (setq e1 (ssget))&lt;BR /&gt;
&amp;gt; (setq e2 (ssget))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; How do I merge or add them into one?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; i.e.   (setq e3 (+ e1 e2))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Steve&lt;BR /&gt;
&amp;gt;&lt;/NGR&gt;</description>
      <pubDate>Wed, 03 May 2000 17:08:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/874195#M158447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-05-03T17:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405658#M158448</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp; I have been trying to use the method you suggested but cannot feed the selection set to the OVERKILL command. Any Idea where I am going wrong?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(command "select" ss1 ss2 ss3 ss4 ss5 ss6 ss7 ""); combine all selection sets for the overkill command
(setq ssAll (ssget "p" ""))
;
(command "-overkill" ssAll "" "I" "none" "O" "0.001" "P" "no" "T" "yes" "E" "yes" "A" "yes" "D")
;&lt;/LI-CODE&gt;&lt;P&gt;I keep getting this error.&lt;/P&gt;&lt;P&gt;"Command: ; error: bad point argument" after the selection set. I can see all seven selection sets being added but it fails after that and I don't know if "ssAll" is being created or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example none of the selection sets are empty but there will be a possibility that they might be empty. I need to write the selection set addition so that it will proceed if any of the seven sets are empty or missing. I got my routine to work on a small simple test drawing but it will not work on a project drawing. It is definitly failing before it loads the OVERKILL command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 23:47:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405658#M158448</guid>
      <dc:creator>cschnarr</dc:creator>
      <dc:date>2020-03-27T23:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405667#M158449</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you did not copy this 20years old lines.&lt;/P&gt;
&lt;P&gt;Steve wrote 03-05-2000:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#999999"&gt;(setq set3&lt;/FONT&gt; &lt;FONT color="#000000"&gt;(ssget "p")&lt;/FONT&gt;&lt;FONT color="#999999"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You wrote now&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#999999"&gt;(setq ssAll&lt;/FONT&gt; &lt;FONT color="#000000"&gt;(ssget "p" "")&lt;/FONT&gt;&lt;FONT color="#999999"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#999999"&gt;That's the problem.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 23:57:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405667#M158449</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-03-27T23:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405746#M158450</link>
      <description>&lt;P&gt;I was able to discover that mistake. Now the problem is the code won't work if any of the selection sets 1-7 is missing. All the selection sets are made with "if" statements, so how do I add only the selection sets that actually exist and avoid errors?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 01:32:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405746#M158450</guid>
      <dc:creator>cschnarr</dc:creator>
      <dc:date>2020-03-28T01:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405753#M158451</link>
      <description>&lt;P&gt;Start with programming, this simple way with select-command is quick and dirty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[F1]&lt;/P&gt;
&lt;P&gt;SSADD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Samples?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See all the other solutions above, post#3 for example&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 01:41:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9405753#M158451</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-03-28T01:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9406100#M158452</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1660044"&gt;@cschnarr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;…. the code won't work if any of the selection sets 1-7 is missing. …. how do I add only the selection sets that actually exist and avoid errors?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maybe something like this [untested]?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(foreach ss (list ss1 ss2 ss3 ss4 ss5 ss6 ss7)
  (if ss ; does it exist? then:
    (if (not ssAll); no overall yet - first one
      (setq ssAll ss); then - start overall with it
      (progn ; else - add it to overall
        (command "_.select" ssAll ss "")
        (setq ssAll (ssget "p"))
      ); progn
    ); if
  ); if
); foreach&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 12:18:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9406100#M158452</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-03-28T12:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge (add) 2 selection sets?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9407046#M158453</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;. I tried it but we are hanging up on an incomplete selection command somewhere. It stops with all the items "selected" on the screen waiting for some additional input. but it does not finish the routine. the command line history shows all the selection sets done and it looks like there is no ss1 or ss2. ss3 selected, ss3 added to ss4, and now ssAll = ss3 + ss4 but ss5 is listed in the command line as "Command: &amp;lt;Selection set: 3065&amp;gt;" but not selected on screen and it stops.&lt;/P&gt;&lt;P&gt;This is the total code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(DEFUN C:SWcleanKill-2 ( / ss1 ss2 ss3 ss4 ss5 ss6 ss7 ssAll)
(setvar "cmdecho" 1)
(setvar "qaflags" 1)
;
;
 (if (setq ss1 (ssget "X" '((6 . "SLD-Center")))); only if it finds some
     (command "._chprop" ss1 "" "la" "CENTER-LINES" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
 (if (setq ss2 (ssget "X" '((6 . "SLD-Chain")))); only if it finds some
     (command "._chprop" ss2 "" "la" "CENTER-LINES-X.5" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
 (if (setq ss3 (ssget "X" '((6 . "SLD-Dashed")))); only if it finds some
     (command "._chprop" ss3 "" "la" "HIDDEN-LINES" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
 (if (setq ss4 (ssget "X" '((6 . "SLD-Phantom")))); only if it finds some
     (command "._chprop" ss4 "" "la" "CUT-BORDER" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
 (if (setq ss5 (ssget "X" '((6 . "SLD-Solid")))); only if it finds some
     (command "._chprop" ss5 "" "la" "OBJ-0" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
 (if (setq ss6 (ssget "X" '((6 . "SLD-Stitch")))); only if it finds some
     (command "._chprop" ss6 "" "la" "HIDDEN-LINES-X.5" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
 (if (setq ss7 (ssget "X" '((6 . "SLD-Thin-Thick-Chain")))); only if it finds some
     (command "._chprop" ss7 "" "la" "CUT-BORDER" "C" "bylayer" "lw" "bylayer" "lt" "bylayer" "")
   );end if
;
(foreach ss (list ss1 ss2 ss3 ss4 ss5 ss6 ss7)
  (if ss ; does it exist? then:
    (if (not ssAll); no overall yet - first one
      (setq ssAll ss); then - start overall with it
      (progn ; else - add it to overall
        (command "_.select" ssAll ss "")
        (setq ssAll (ssget "p"))
      ); progn
    ); if
  ); if
); foreach
;
(command)(command)
;
 (command "-overkill" ssAll "I" "none" "O" "0.001" "P" "no" "T" "yes" "E" "yes" "A" "yes" "D")
;
(setvar "qaflags" 0)
(setvar "cmdecho" 0)   
;
);	END DEFUN&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;We are really close to a solution. Sample file attached.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 03:58:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-merge-add-2-selection-sets/m-p/9407046#M158453</guid>
      <dc:creator>cschnarr</dc:creator>
      <dc:date>2020-03-29T03:58:02Z</dc:date>
    </item>
  </channel>
</rss>

