<?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: Selection Set Filter - Block Name CONTAINS in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867848#M17953</link>
    <description>&lt;P&gt;As &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; said, you cannot directly filter anonymous blocks (*Uxxx blocks) with a selection filter.&lt;/P&gt;
&lt;P&gt;You have to select also all the anoynmous blocks and check for each selected block if the name of its DynamicBlockTableRecord (AKA effective name) matches with your pattern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Here's an example:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[CommandMethod("TEST1")]
public static void Test1()
{
    var ed = Application.DocumentManager.MdiActiveDocument.Editor;
    var filter = new SelectionFilter(new[] {
        new TypedValue(0, "INSERT"),
        new TypedValue(2, "`*U*,*-SIGN-*") });
    var psr = ed.GetSelection(filter);
    if (psr.Status == PromptStatus.OK)
    {
        var db = HostApplicationServices.WorkingDatabase;
        using (var tr = db.TransactionManager.StartTransaction())
        {
            var ids = new ObjectIdCollection();
            // filter anonymous blocks
            foreach (var id in psr.Value.GetObjectIds())
            {
                var br = (BlockReference)tr.GetObject(id, OpenMode.ForRead);
                string effectiveName =
                    ((BlockTableRecord)tr.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead)).Name;
                if (Autodesk.AutoCAD.Internal.Utils.WcMatchEx(effectiveName, "*-SIGN-*", true))
                    ids.Add(id);
            }
            var selectedIds = new ObjectId[ids.Count];
            ids.CopyTo(selectedIds, 0);
            ed.SetImpliedSelection(selectedIds);
            tr.Commit();
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also do this 'on the fly' by handling the Editor.SelectionAdded event:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[CommandMethod("TEST2")]
public static void Test2()
{
    var ed = Application.DocumentManager.MdiActiveDocument.Editor;
    var filter = new SelectionFilter(new[] {
        new TypedValue(0, "INSERT"),
        new TypedValue(2, "`*U*,*-SIGN-*") });
    ed.SelectionAdded += SelectionAdded;
    var psr = ed.GetSelection(filter);
    ed.SelectionAdded -= SelectionAdded;
    if (psr.Status == PromptStatus.OK)
        ed.SetImpliedSelection(psr.Value);
}

private static void SelectionAdded(object sender, SelectionAddedEventArgs e)
{
    using (var tr = new OpenCloseTransaction())
    {
        for (int i = 0; i &amp;lt; e.AddedObjects.Count; i++)
        {
            var br = (BlockReference)tr.GetObject(e.AddedObjects[i].ObjectId, OpenMode.ForRead);
            string effectiveName =
                ((BlockTableRecord)tr.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead)).Name;
            if (!Autodesk.AutoCAD.Internal.Utils.WcMatchEx(effectiveName, "*-SIGN-*", true))
                e.Remove(i);
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 17:10:38 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2020-11-13T17:10:38Z</dc:date>
    <item>
      <title>Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867341#M17948</link>
      <description>&lt;P&gt;I know its possible to set a filter list for a block and its name by doing the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim filterlist As TypedValue() = New TypedValue(1) {}
            filterlist(0) = New TypedValue(0, "INSERT")
            filterlist(1) = New TypedValue(2, "ABC")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But is it possible to set a filter list by "Contains"? Meaning only select blocks (Dynamic or static) that name contains "-SIGN-". So the block name may be XXXX-SIGN-XXXX-XXX. And it will only allow for the selection of blocks that name contains "-SIGN-".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 13:57:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867341#M17948</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2020-11-13T13:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867430#M17949</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In selction filters, the values of type string honor the &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=GUID-3C1A759C-BB88-41A7-B1DE-697C493C92C8" target="_blank" rel="noopener"&gt;wild-card patterns.&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;new TypedValue(2, "*-SIGN_*");&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 14:28:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867430#M17949</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2020-11-13T14:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867456#M17950</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp; As always, thank you so much! You are the best! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 14:35:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867456#M17950</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2020-11-13T14:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867682#M17951</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey sorry But it does not seem to be working. I have tried all three below with no luck. It will not select the blocks. (Note some are Dynamic and some are static) But it doesn't select either. It works perfect with the single Typed Value&amp;nbsp;Dim acSelectionFilterAll = New TypedValue() {New TypedValue(0, "INSERT")}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim acPromptSelectionOptionsAll As PromptSelectionOptions = New PromptSelectionOptions()
        Dim acSelectionFilterAll = New SelectionFilter({New TypedValue(0, "INSERT"), New TypedValue(2, "*-SIGN-*")})
        acPromptSelectionOptionsAll.MessageForAdding = "Please Select ALL Traffic Sign Details: "
        acPromptSelectionOptionsAll.MessageForRemoval = "Select a Traffic Sign Detail to remove: "
        Dim acPromptSelectionResultsAll As PromptSelectionResult = acCurrentEditor.GetSelection(acPromptSelectionOptionsAll, acSelectionFilterAll)&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;Dim acPromptSelectionOptionsAll As PromptSelectionOptions = New PromptSelectionOptions()
        Dim acSelectionFilterAll As TypedValue() = New TypedValue(1) {New TypedValue(0, "INSERT"), New TypedValue(2, "*-SIGN-*")}
        acPromptSelectionOptionsAll.MessageForAdding = "Please Select ALL  Traffic Sign Details: "
        acPromptSelectionOptionsAll.MessageForRemoval = "Select a  Traffic Sign Detail to remove: "
        Dim acPromptSelectionResultsAll As PromptSelectionResult = acCurrentEditor.GetSelection(acPromptSelectionOptionsAll, New SelectionFilter(acSelectionFilterAll))&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;Dim acPromptSelectionOptionsAll As PromptSelectionOptions = New PromptSelectionOptions()
        Dim acSelectionFilterAll As TypedValue() = New TypedValue(1) {}
        acSelectionFilterAll(0) = New TypedValue(0, "INSERT")
        acSelectionFilterAll(1) = New TypedValue(2, "*-SIGN-*")
        acPromptSelectionOptionsAll.MessageForAdding = "Please Select ALL Traffic Sign Details: "
        acPromptSelectionOptionsAll.MessageForRemoval = "Select a Traffic Sign Detail to remove: "
        Dim acPromptSelectionResultsAll As PromptSelectionResult = acCurrentEditor.GetSelection(acPromptSelectionOptionsAll, New SelectionFilter(acSelectionFilterAll))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 16:12:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867682#M17951</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2020-11-13T16:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867762#M17952</link>
      <description>&lt;P&gt;Dynamic BlockReference&amp;nbsp; cannot be selected by your block name filter, because its name is something like "*Uxxxx". If you want to get a SelectionSet to select block references which could be/include dynamic ones, you should avoid using block name filter. Instead, you identify them after the selectionset is returned and you loop through them in following code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 16:37:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867762#M17952</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2020-11-13T16:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867848#M17953</link>
      <description>&lt;P&gt;As &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt; said, you cannot directly filter anonymous blocks (*Uxxx blocks) with a selection filter.&lt;/P&gt;
&lt;P&gt;You have to select also all the anoynmous blocks and check for each selected block if the name of its DynamicBlockTableRecord (AKA effective name) matches with your pattern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Here's an example:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[CommandMethod("TEST1")]
public static void Test1()
{
    var ed = Application.DocumentManager.MdiActiveDocument.Editor;
    var filter = new SelectionFilter(new[] {
        new TypedValue(0, "INSERT"),
        new TypedValue(2, "`*U*,*-SIGN-*") });
    var psr = ed.GetSelection(filter);
    if (psr.Status == PromptStatus.OK)
    {
        var db = HostApplicationServices.WorkingDatabase;
        using (var tr = db.TransactionManager.StartTransaction())
        {
            var ids = new ObjectIdCollection();
            // filter anonymous blocks
            foreach (var id in psr.Value.GetObjectIds())
            {
                var br = (BlockReference)tr.GetObject(id, OpenMode.ForRead);
                string effectiveName =
                    ((BlockTableRecord)tr.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead)).Name;
                if (Autodesk.AutoCAD.Internal.Utils.WcMatchEx(effectiveName, "*-SIGN-*", true))
                    ids.Add(id);
            }
            var selectedIds = new ObjectId[ids.Count];
            ids.CopyTo(selectedIds, 0);
            ed.SetImpliedSelection(selectedIds);
            tr.Commit();
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also do this 'on the fly' by handling the Editor.SelectionAdded event:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[CommandMethod("TEST2")]
public static void Test2()
{
    var ed = Application.DocumentManager.MdiActiveDocument.Editor;
    var filter = new SelectionFilter(new[] {
        new TypedValue(0, "INSERT"),
        new TypedValue(2, "`*U*,*-SIGN-*") });
    ed.SelectionAdded += SelectionAdded;
    var psr = ed.GetSelection(filter);
    ed.SelectionAdded -= SelectionAdded;
    if (psr.Status == PromptStatus.OK)
        ed.SetImpliedSelection(psr.Value);
}

private static void SelectionAdded(object sender, SelectionAddedEventArgs e)
{
    using (var tr = new OpenCloseTransaction())
    {
        for (int i = 0; i &amp;lt; e.AddedObjects.Count; i++)
        {
            var br = (BlockReference)tr.GetObject(e.AddedObjects[i].ObjectId, OpenMode.ForRead);
            string effectiveName =
                ((BlockTableRecord)tr.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead)).Name;
            if (!Autodesk.AutoCAD.Internal.Utils.WcMatchEx(effectiveName, "*-SIGN-*", true))
                e.Remove(i);
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 17:10:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867848#M17953</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2020-11-13T17:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867964#M17954</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK So its sort of working now, it is filtering but it is now bypassing the second prompt. I turned your test1 into a function to return the objectid collection and run a for each on all of them. The problem I have is it now skips the second prompt and leaves the objects selected at the end of the command. Im sure its something simple stupid. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I belive I need to convert the objectID collection to a selection set. Just not sure how to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fucntion:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function FilterDetails(ByVal acPromptSelectionResultsAll As PromptSelectionResult)

        Dim ids = New ObjectIdCollection()

        Using acTranaction As Transaction = Active.Database.TransactionManager.StartTransaction()

            For Each id In acPromptSelectionResultsAll.Value.GetObjectIds()

                Dim br = CType(acTranaction.GetObject(id, OpenMode.ForRead), BlockReference)
                Dim effectiveName As String = (CType(acTranaction.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead), BlockTableRecord)).Name
                If Autodesk.AutoCAD.Internal.Utils.WcMatchEx(effectiveName, "*-SIGN-*", True) Then ids.Add(id)

            Next

            Dim selectedIds = New ObjectId(ids.Count - 1) {}
            ids.CopyTo(selectedIds, 0)
            acCurrentEditor.SetImpliedSelection(selectedIds)
            acTranaction.Commit()

        End Using

        Return ids

    End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Public Sub SelectDetails()

        Dim acPromptSelectionOptionsAll As PromptSelectionOptions = New PromptSelectionOptions()
        Dim acSelectionFilterAll = New SelectionFilter({New TypedValue(0, "INSERT"), New TypedValue(2, "`*U*,*-SIGN-*")})
        acPromptSelectionOptionsAll.MessageForAdding = "Please Select ALL Traffic Sign Details: "
        acPromptSelectionOptionsAll.MessageForRemoval = "Select a Traffic Sign Detail to remove: "
        Dim acPromptSelectionResultsAll As PromptSelectionResult = acCurrentEditor.GetSelection(acPromptSelectionOptionsAll, acSelectionFilterAll)

        If acPromptSelectionResultsAll.Status = PromptStatus.OK Then

            Dim acSelectionSetAllFiltered = FilterDetails(acPromptSelectionResultsAll)

            Dim acPromptSelectionOptionsExisting As PromptSelectionOptions = New PromptSelectionOptions()
            Dim acSelectionFilterExisting = New SelectionFilter({New TypedValue(0, "INSERT"), New TypedValue(2, "`*U*,*-SIGN-*")})
            acPromptSelectionOptionsExisting.MessageForAdding = "Please Select the Traffic Sign Details to be Exiting: "
            acPromptSelectionOptionsExisting.MessageForRemoval = "Select a Traffic Sign Detail to remove: "
            Dim acPromptSelectionResultsExisting As PromptSelectionResult = acCurrentEditor.GetSelection(acPromptSelectionOptionsExisting, acSelectionFilterExisting)

            If acPromptSelectionResultsExisting.Status = PromptStatus.OK Then

                Dim acSelectionSetExistingFiltered = FilterDetails(acPromptSelectionResultsExisting)

                CreateDetailLayer("G-DTLS-TRAF-SIGN-EXST", 253, "G04030(253)", "Details: Traffic Sign Details - Existing")
                CreateDetailLayer("G-DTLS-TRAF-SIGN-PROP", 3, "B025(11)", "Details: Traffic Sign Details - Proposed")

                For Each acSelectedObjectId In acSelectionSetAllFiltered

                    If Not IsDBNull(acSelectedObjectId) Then

                        SetDetailState(acSelectedObjectId, "G-DTLS-TRAF-SIGN-PROP")

                    End If

                Next

                For Each acSelectedObjectId In acSelectionSetExistingFiltered

                    If Not IsDBNull(acSelectedObjectId) Then

                        SetDetailState(acSelectedObjectId, "G-DTLS-TRAF-SIGN-EXST")

                    End If

                Next

            Else

                CreateDetailLayer("G-DTLS-TRAF-SIGN-PROP", 3, "B025(11)", "Details: Traffic Sign Details - Proposed")

                For Each acSelectedObject In acSelectionSetAllFiltered

                    If Not IsDBNull(acSelectedObject) Then

                        SetDetailState(acSelectedObject, "G-DTLS-TRAF-SIGN-PROP")

                    End If

                Next

            End If

            FreezeDetailGridLayers()

        End If

        acCurrentEditor.Regen()

    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears to be doing the following to all selected:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;For Each acSelectedObjectId In acSelectionSetExistingFiltered

                    If Not IsDBNull(acSelectedObjectId) Then

                        SetDetailState(acSelectedObjectId, "G-DTLS-TRAF-SIGN-EXST")

                    End If

                Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:13:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9867964#M17954</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2020-11-13T18:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868047#M17955</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/99495"&gt;@David_Prontnicki&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;I belive I need to convert the objectID collection to a selection set. Just not sure how to do that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you absolutely need a selection set you can&amp;nbsp; create a new one frolm an ObjetcId array using the &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_EditorInput_SelectionSet_FromObjectIds_ObjectId__" target="_blank" rel="noopener"&gt;SelectionSet.FromObjectIds&lt;/A&gt; static method.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:33:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868047#M17955</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2020-11-13T18:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868059#M17956</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize, I do not follow how to achieve that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SelectionSet.FromObjectIds is not an option.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:39:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868059#M17956</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2020-11-13T18:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868168#M17957</link>
      <description>&lt;P&gt;Here's an example:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;        [CommandMethod("TEST1")]
        public static void Test1()
        {
            var ed = Application.DocumentManager.MdiActiveDocument.Editor;
            var filter = new SelectionFilter(new[] {
        new TypedValue(0, "INSERT"),
        new TypedValue(2, "`*U*,*-SIGN-*") });
            var psr = ed.GetSelection(filter);
            if (psr.Status == PromptStatus.OK)
            {
                var db = HostApplicationServices.WorkingDatabase;
                using (var tr = db.TransactionManager.StartTransaction())
                {
                    var ids = new ObjectIdCollection();
                    // filter anonymous blocks
                    foreach (var id in psr.Value.GetObjectIds())
                    {
                        var br = (BlockReference)tr.GetObject(id, OpenMode.ForRead);
                        string effectiveName =
                            ((BlockTableRecord)tr.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead)).Name;
                        if (Autodesk.AutoCAD.Internal.Utils.WcMatchEx(effectiveName, "*-SIGN-*", true))
                            ids.Add(id);
                    }

                    // convert the ObjectIdCollection into an ObjectId array
                    var selectedIds = new ObjectId[ids.Count];
                    ids.CopyTo(selectedIds, 0);

                    // convert the ObjectId array into a SelectionSet
                    var selectionSet = SelectionSet.FromObjectIds(selectedIds);

                    // grip the selection set
                    ed.SetImpliedSelection(selectionSet);

                    tr.Commit();
                }
            }
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 19:27:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868168#M17957</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2020-11-13T19:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Set Filter - Block Name CONTAINS</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868208#M17958</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much, I ended up having the same problem. What I found was if I removed the line,&lt;/P&gt;&lt;P&gt;ed.SetImpliedSelection(selectedIds)&lt;/P&gt;&lt;P&gt;from the function, it worked as it should. That was causing the program to skip the next prompt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So long story short it is working. Thank you again for all your help!!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 19:48:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-filter-block-name-contains/m-p/9868208#M17958</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2020-11-13T19:48:07Z</dc:date>
    </item>
  </channel>
</rss>

