<?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: Delete all named selection sets in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148658#M21856</link>
    <description>I am currently using:&lt;BR /&gt;
[code]&lt;BR /&gt;
Dim ssSelSets As AcadSelectionSets&lt;BR /&gt;
Dim ssSelSet As AcadSelectionSet&lt;BR /&gt;
Dim i As Integer&lt;BR /&gt;
For i = (ssSelSets.Count - 1) To 0 Step -1&lt;BR /&gt;
    Set ssSelSet = Application.ActiveDocument.SelectionSets(i)&lt;BR /&gt;
    ssSelSet.Delete&lt;BR /&gt;
Next i&lt;BR /&gt;
'===============&lt;BR /&gt;
But it looks yours is better. I tweeked it a bit:&lt;BR /&gt;
&lt;BR /&gt;
While ThisDrawing.SelectionSets.Count &amp;gt; 0&lt;BR /&gt;
    ThisDrawing.SelectionSets.Item(0).Delete&lt;BR /&gt;
Wend&lt;BR /&gt;
[/code]&lt;BR /&gt;
many thanks!</description>
    <pubDate>Fri, 04 Jan 2008 18:16:54 GMT</pubDate>
    <dc:creator>mdhutchinson</dc:creator>
    <dc:date>2008-01-04T18:16:54Z</dc:date>
    <item>
      <title>Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148656#M21854</link>
      <description>How can I delete all named selection sets from a drawing?&lt;BR /&gt;
I tried a simple interation thru the collection to do it and I crashed AutoCAD.</description>
      <pubDate>Fri, 04 Jan 2008 16:44:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148656#M21854</guid>
      <dc:creator>mdhutchinson</dc:creator>
      <dc:date>2008-01-04T16:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148657#M21855</link>
      <description>Have you tried&lt;BR /&gt;
&lt;BR /&gt;
If ThisDrawing.SelectionSets.Count &amp;gt; 0 Then&lt;BR /&gt;
    While ThisDrawing.SelectionSets.Count &amp;gt; 0&lt;BR /&gt;
        ThisDrawing.SelectionSets.Item(ThisDrawing.SelectionSets.Count - 1).Delete&lt;BR /&gt;
    Wend&lt;BR /&gt;
End If</description>
      <pubDate>Fri, 04 Jan 2008 17:56:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148657#M21855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-04T17:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148658#M21856</link>
      <description>I am currently using:&lt;BR /&gt;
[code]&lt;BR /&gt;
Dim ssSelSets As AcadSelectionSets&lt;BR /&gt;
Dim ssSelSet As AcadSelectionSet&lt;BR /&gt;
Dim i As Integer&lt;BR /&gt;
For i = (ssSelSets.Count - 1) To 0 Step -1&lt;BR /&gt;
    Set ssSelSet = Application.ActiveDocument.SelectionSets(i)&lt;BR /&gt;
    ssSelSet.Delete&lt;BR /&gt;
Next i&lt;BR /&gt;
'===============&lt;BR /&gt;
But it looks yours is better. I tweeked it a bit:&lt;BR /&gt;
&lt;BR /&gt;
While ThisDrawing.SelectionSets.Count &amp;gt; 0&lt;BR /&gt;
    ThisDrawing.SelectionSets.Item(0).Delete&lt;BR /&gt;
Wend&lt;BR /&gt;
[/code]&lt;BR /&gt;
many thanks!</description>
      <pubDate>Fri, 04 Jan 2008 18:16:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148658#M21856</guid>
      <dc:creator>mdhutchinson</dc:creator>
      <dc:date>2008-01-04T18:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148659#M21857</link>
      <description>okay... next question:&lt;BR /&gt;
&lt;BR /&gt;
It seems that I can:&lt;BR /&gt;
&lt;BR /&gt;
Set MySelSet = Nothing&lt;BR /&gt;
but the selection set can still be retrieved via the name property?... is this correct?&lt;BR /&gt;
... although&lt;BR /&gt;
If I delete the selection set of a given name... the variable is destroyed... correct?</description>
      <pubDate>Fri, 04 Jan 2008 18:30:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148659#M21857</guid>
      <dc:creator>mdhutchinson</dc:creator>
      <dc:date>2008-01-04T18:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148660#M21858</link>
      <description>I am not a pro, so take this with a grain of salt.  When you set your variable to nothing, e.g. Set MySelSet = Nothing, you are just removing the pointer to the selectionset object, it still exist in the selectionset collection.  However, when you delete the object, the variable has nothing to point to, so it is not available.</description>
      <pubDate>Sat, 05 Jan 2008 05:02:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148660#M21858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-05T05:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148661#M21859</link>
      <description>it depends on the nature of the object you are pointing to.&lt;BR /&gt;
an object may have many variables pointing on it, and there is a counter of them. when last variable pointing to object is removed [either by going out of the scope or changing value fe setting to nothing], the runtime sends request to object to delete himself [each object has some kind of constructor and destructor methods]. now, it depends on the object should it accept request for self-deleting or not. usualy such non-self-deleting objects have special "delete" method that you must separately call to delete such object</description>
      <pubDate>Sat, 05 Jan 2008 10:36:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148661#M21859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-05T10:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148662#M21860</link>
      <description>You deserve a medal for this sub routine.&lt;BR /&gt;
&lt;BR /&gt;
THANK YOU!!!</description>
      <pubDate>Thu, 26 Jun 2008 14:27:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148662#M21860</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-26T14:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all named selection sets</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148663#M21861</link>
      <description>I use the similar one&lt;BR /&gt;
&lt;BR /&gt;
     Dim oSset As AcadSelectionSet&lt;BR /&gt;
          With ThisDrawing.SelectionSets&lt;BR /&gt;
               While .Count &amp;gt; 0&lt;BR /&gt;
                    .Item(0).Delete&lt;BR /&gt;
               Wend&lt;BR /&gt;
          Set oSset = .Add("NewOne")&lt;BR /&gt;
          End With&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Thu, 26 Jun 2008 22:16:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-all-named-selection-sets/m-p/2148663#M21861</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-26T22:16:08Z</dc:date>
    </item>
  </channel>
</rss>

