<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Remove Individual Annotation Groups</title><link>https://communities.bentley.com/products/road___site_design/f/geopak-inroads-mx-openroads-forum/228930/remove-individual-annotation-groups</link><description>I&amp;#39;m working in ORD 2021 R1. Wondering if there is any way to remove individual annotation groups from the cross sections? I originally annotated all drawing models with EAV and have ultimately decided I wanted to remove it. We can add individual annotation</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/747069?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 15:06:13 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e499de8d-42ea-4336-9661-c71c1d630863</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Same here - i have about a dozen that haven&amp;#39;t shown up from a few ago.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/746917?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2022 14:55:12 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:c446a7f1-4ef8-4c6c-be3c-5d11bf41da56</guid><dc:creator>Derek Schmidt</dc:creator><description>[quote userid="850497" url="~/products/road___site_design/f/geopak-inroads-mx-openroads-forum/228930/remove-individual-annotation-groups/710742"]For now, I have to hard code the name of the annotation group. As I learn more VBA,[/quote]
&lt;p&gt;I recommend a couple&amp;nbsp;changes&amp;nbsp;as alternatives that might help you in your VBA experience and the longevity of this script and future work.&lt;/p&gt;
&lt;p&gt;1. Instead of setting the value of oGroupName in line 24, move that line up to line 2 to make it more obvious and so make the sub more repurposable.&lt;/p&gt;
&lt;p&gt;2. Instead of setting the value of oGroupName at all within this sub, have the sub receive that value as an argument and rename the sub: Sub deleteAnnoByGroupName(oGroupName As String). As for using it, create a new sub that does nothing but call this sub with the desired group name: deleteAnnoByGroupName &amp;quot;Design Annotations\XS Edge of Pavement\&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/746915?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2022 14:38:37 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6e78c61b-5074-4245-a81f-0bd068262d46</guid><dc:creator>Matthew Eiben</dc:creator><description>&lt;p&gt;I submitted this to the Ideas page a week or two ago. Looks like it&amp;#39;s still under review or maybe didn&amp;#39;t go through yet. But I did get a confirmation email. I had also submitted Enhancement Request &lt;span&gt;977276 a few months ago.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/746911?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2022 14:00:02 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:812b8f34-a27c-47f1-9a0f-ed5de795f0ce</guid><dc:creator>Josh M</dc:creator><description>&lt;p&gt;Mark,&lt;/p&gt;
&lt;p&gt;This looks like a great solution.&amp;nbsp; I didn&amp;#39;t find this on the OpenCivil Product Ideas site.&amp;nbsp; Have you thought about adding it there so perhaps it can be added to the product itself?&amp;nbsp; I&amp;#39;m certain it would get a lot of votes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/746834?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2022 00:49:57 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:13b7f748-5cc3-46bc-92a0-a71ad1388615</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Awesome Derek, looks good.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking of enhancing this to provide a dialog with a list of currently found Annotation Group instances instead of needing to pre-select an element from a group as another option. Hopefully will have that done in the not too distant future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/746813?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2022 19:47:55 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:04dcb3e2-3483-44eb-815c-c2131f5008ae</guid><dc:creator>Derek Schmidt</dc:creator><description>&lt;p&gt;This is great, Mark. Thanks for this. It saves a huge amount of time, as now it takes just a couple seconds to run through 20 or so models. I made a few changes that I think I&amp;#39;ll capture here:&lt;/p&gt;
&lt;p&gt;* I revised some variable names to make them more explicit as to their purpose.&lt;/p&gt;
&lt;p&gt;* I added declaration lines because I use Option Explicit.&lt;/p&gt;
&lt;p&gt;* I changed ShowMessage to MsgBox because VBA was telling me the function wasn&amp;#39;t working, but I changed nothing else about those lines.&lt;/p&gt;
&lt;p&gt;* I added a loop to cycle through all of the user&amp;#39;s initial selection set rather than just the first one. (This is a less important improvement because the alternative is that the user would simply run the script multiple times according to the selection set.)&lt;/p&gt;
&lt;p&gt;At the top I mentioned this thread&amp;#39;s URL for reference.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Sub deleteAnnoInAllModelsOfSameFile()
    &amp;#39;substantially identical to the script that Mark Shamoun offered here: _
        https://communities.bentley.com/products/road___site_design/f/geopak-inroads-mx-openroads-forum/228930/remove-individual-annotation-groups/709368 _
        but with some variable names changed and a loop introduced to cycle through all of the user&amp;#39;s selection set instead of just the first element&amp;#39;s group
    Dim oScanEnumerator As ElementEnumerator, eeInitialSelection As ElementEnumerator, ph As PropertyHandler
    Dim oGroupName As String, ph0 As PropertyHandler, oElement As Element, oSelected As Element, oModel As ModelReference
    
    Dim count_drawing_models As Long
    Dim oSearch As String, oNew As String
    Dim totModels As Long
    Dim count_within_Model As Long, count_total_deleted As Long, count_annotation_elements As Long
    Dim count_Model_affected As Long
    Dim oRun As Long
    
    
    If ActiveModelReference.Type = msdModelTypeDrawing Then
    
        For Each oModel In ActiveDesignFile.Models
            If oModel.Type = msdModelTypeDrawing Then
                count_drawing_models = count_drawing_models + 1
            End If
        Next
        
        If ActiveModelReference.AnyElementsSelected = False Then
            CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
            ShowMessage &amp;quot;ERROR - No elements selected&amp;quot;, , msdMessageCenterPriorityError, True
            GoTo finish
        Else
            Set eeInitialSelection = ActiveModelReference.GetSelectedElements
            Do While eeInitialSelection.MoveNext
               Set oSelected = eeInitialSelection.Current
               
               If oSelected.ModelReference.IsAttachment = False And oSelected.ModelReference.Name = ActiveModelReference.Name Then
                   Set ph0 = CreatePropertyHandler(oSelected)
                   If ph0.SelectByAccessString(&amp;quot;Groups[0].Description&amp;quot;) = True Then
                       oSearch = InStr(ph0.GetDisplayString, &amp;quot;\&amp;quot;)
                       oGroupName = Left(ph0.GetDisplayString, oSearch)
                       
                       If ph0.GetDisplayString = &amp;quot;&amp;quot; Then
                           CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                           ShowMessage &amp;quot;ERROR - Selected element is not Civil Annotation&amp;quot;, , msdMessageCenterPriorityError, True
                           GoTo finish
                       End If
                   Else
                       CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                       ShowMessage &amp;quot;ERROR - Selected element is not Civil Annotation&amp;quot;, , msdMessageCenterPriorityError, True
                       GoTo finish
                   End If
    
               Else
                   CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                   ShowMessage &amp;quot;ERROR - Only elements in active model can be used for this tool&amp;quot;, , msdMessageCenterPriorityError, True
                   GoTo finish
               End If
               
               
               &amp;#39; Save current model name
               &amp;#39;currMod = ActiveModelReference.Name
           
               Dim oScanCriteria As New ElementScanCriteria
           
               &amp;#39; Cycle through models and delete matching annotation group elements
               For Each oModel In ActiveDesignFile.Models
               
                   If oModel.Type = msdModelTypeDrawing Then
                       totModels = totModels + 1
                       
                       count_within_Model = 0
                       
                       oScanCriteria.IncludeOnlyVisible
                       oScanCriteria.ExcludeNonGraphical
                       
                       Set oScanEnumerator = oModel.Scan(oScanCriteria)
                       oRun = 1
                       
                       &amp;#39;oModel.Activate
                       ShowTempMessage msdStatusBarAreaMiddle, &amp;quot;Processing Drawing model &amp;quot; + CStr(totModels) + &amp;quot; of &amp;quot; + CStr(count_drawing_models) + &amp;quot;...&amp;quot;
                       
                       Do While oScanEnumerator.MoveNext
                           Set oElement = oScanEnumerator.Current
                           count_total_deleted = count_total_deleted + 1
                           If oElement.IsGraphical = True And oElement.ModelReference.Name = oModel.Name And oElement.ModelReference.IsAttachment = False Then
                               Set ph = CreatePropertyHandler(oElement)
                               If ph.SelectByAccessString(&amp;quot;Groups[0].Description&amp;quot;) = True Then
                                   oSearch = &amp;quot;&amp;quot;
                                   oSearch = InStr(ph.GetDisplayString, &amp;quot;\&amp;quot;)
                                   oNew = Left(ph.GetDisplayString, oSearch)
                                                            
                                   If StrComp(oNew, oGroupName, vbBinaryCompare) = 0 Then
                                       oModel.RemoveElement oElement &amp;#39;TODO: reactivate this
                                       count_annotation_elements = count_annotation_elements + 1
                                       count_within_Model = count_within_Model + 1 &amp;#39;TODO: should this be count_annotation_elements ?
                                   End If
                                   
                               End If
                           End If
                       Loop
                   
                       If count_within_Model &amp;gt; 0 Then
                           count_Model_affected = count_Model_affected + 1
                       End If
                       
                   End If
                   
                   Set oElement = Nothing
                   Set oModel = Nothing
                   Set oScanEnumerator = Nothing
                   
               Next
               
               
               &amp;#39; Return to original model
               &amp;#39;ActiveDesignFile.Models(currMod).Activate
               
           
               CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
               If count_annotation_elements &amp;gt; 0 Then
                   MsgBox CStr(count_annotation_elements) &amp;amp; &amp;quot; total annotation element(s)  deleted from &amp;quot; &amp;amp; CStr(count_Model_affected) &amp;amp; &amp;quot; Drawing models.&amp;quot; _
                        &amp;amp; vbNewLine _
                        &amp;amp; vbNewLine &amp;amp; &amp;quot;Removed Annotation Group: &amp;quot; _
                        &amp;amp; vbNewLine &amp;amp; Left(ph0.GetDisplayString, oSearch - 1) _
                        , , msdMessageCenterPriorityInfo, True
               Else
                   MsgBox &amp;quot;No associated Civil Annotation found in any Drawing models&amp;quot;, , msdMessageCenterPriorityWarning, True
               End If
            Loop &amp;#39;eeInitialSelection.MoveNext
        End If
                    
    Else
    
        CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
        ShowMessage &amp;quot;ERROR - Tool can only be run in a Drawing model&amp;quot;, , msdMessageCenterPriorityError, True
    End If
    
    GoTo finish
    
skip:


finish:

    CommandState.StartDefaultCommand
    Exit Sub

End Sub
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/710742?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 09:10:57 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:9f1317a8-e3d2-4c30-888f-187d158611df</guid><dc:creator>Andrew Wagner</dc:creator><description>&lt;p&gt;Mark,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m relatively green at MicroStation VBA (and VBA in general), but after some self-study, I was able to understand most of what&amp;#39;s going on here. I made some changes, and it worked great.&lt;/p&gt;
&lt;p&gt;For now, I have to hard code the name of the annotation group. As I learn more VBA, I might try to set something up that lets the user pick from a list of annotation groups that exist in the cross-section container DGN. Guessing I would have to nest the batch process inside the procedure somewhere after the user picks the annotation group to remove.&amp;nbsp;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;Sub deleteAnnoEOP()

    Dim oScanEnumerator As ElementEnumerator, oScanEnumerator0 As ElementEnumerator, ph As PropertyHandler
    Dim oGroupName As String, ph0 As PropertyHandler, oElement As Element, oSelected As Element, oModel As ModelReference

    If ActiveModelReference.Type = msdModelTypeDrawing Then
    
        For Each oModel In ActiveDesignFile.Models
            If oModel.Type = msdModelTypeDrawing Then
                countDrawings = countDrawings + 1
            End If
        Next
        
        
        
            &amp;#39;Set oScanEnumerator0 = ActiveModelReference.GetSelectedElements
            &amp;#39;oScanEnumerator0.MoveNext
            &amp;#39;Set oSelected = oScanEnumerator0.Current
            
            &amp;#39;If oSelected.ModelReference.IsAttachment = False And oSelected.ModelReference.Name = ActiveModelReference.Name Then
                &amp;#39;Set ph0 = CreatePropertyHandler(oSelected)
               &amp;#39; If ph0.SelectByAccessString(&amp;quot;Groups[0].Description&amp;quot;) = True Then
                    &amp;#39;oSearch = InStr(ph0.GetDisplayString, &amp;quot;\&amp;quot;)
                    oGroupName = &amp;quot;Design Annotations\XS Edge of Pavement\&amp;quot;
                    
                    &amp;#39;If ph0.GetDisplayString = &amp;quot;&amp;quot; Then
                       &amp;#39; CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                        &amp;#39;ShowMessage &amp;quot;ERROR - Selected element is not Civil Annotation&amp;quot;, , msdMessageCenterPriorityError, True
                       &amp;#39; GoTo finish
                    &amp;#39;End If
                &amp;#39;Else
                    &amp;#39;CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                   &amp;#39; ShowMessage &amp;quot;ERROR - Selected element is not Civil Annotation&amp;quot;, , msdMessageCenterPriorityError, True
                    &amp;#39;GoTo finish
               &amp;#39; End If
 
            &amp;#39;Else
                &amp;#39;CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                &amp;#39;ShowMessage &amp;quot;ERROR - Only elements in active model can be used for this tool&amp;quot;, , msdMessageCenterPriorityError, True
                &amp;#39;GoTo finish
            &amp;#39;End If
            
            
            &amp;#39; Save current model name
            &amp;#39;currMod = ActiveModelReference.Name
        
            Dim oScanCriteria As New ElementScanCriteria
        
            &amp;#39; Cycle through models and delete matching annotation group elements
            For Each oModel In ActiveDesignFile.Models
            
                If oModel.Type = msdModelTypeDrawing Then
                    totmodels = totmodels + 1
                    
                    count1 = 0
                    
                    oScanCriteria.IncludeOnlyVisible
                    oScanCriteria.ExcludeNonGraphical
                    
                    Set oScanEnumerator = oModel.Scan(oScanCriteria)
                    oRun = 1
                    
                    &amp;#39;oModel.Activate
                    ShowTempMessage msdStatusBarAreaMiddle, &amp;quot;Processing Drawing model &amp;quot; + CStr(totmodels) + &amp;quot; of &amp;quot; + CStr(countDrawings) + &amp;quot;...&amp;quot;
                    
                    Do While oScanEnumerator.MoveNext
                        Set oElement = oScanEnumerator.Current
                        countTot = countTot + 1
                        If oElement.IsGraphical = True And oElement.ModelReference.Name = oModel.Name And oElement.ModelReference.IsAttachment = False Then
                            Set ph = CreatePropertyHandler(oElement)
                            If ph.SelectByAccessString(&amp;quot;Groups[0].Description&amp;quot;) = True Then
                                oSearch = &amp;quot;&amp;quot;
                                oSearch = InStrRev(ph.GetDisplayString, &amp;quot;\&amp;quot;)
                                oNew = Left(ph.GetDisplayString, oSearch)
                                                         
                                If StrComp(oNew, oGroupName, vbBinaryCompare) = 0 Then
                                    oModel.RemoveElement oElement
                                    Count = Count + 1
                                    count1 = Count + 1
                                End If
                                
                            End If
                        End If
                    Loop
                
                    If count1 &amp;gt; 0 Then
                        countMod = countMod + 1
                    End If
                    
                End If
                
                Set oElement = Nothing
                Set oModel = Nothing
                Set oScanEnumerator = Nothing
                
            Next
            
            
            &amp;#39; Return to original model
            &amp;#39;ActiveDesignFile.Models(currMod).Activate
            
        
            
    
        
                    
    Else
    
        CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
        ShowMessage &amp;quot;ERROR - Tool can only be run in a Drawing model&amp;quot;, , msdMessageCenterPriorityError, True
    End If
    
    GoTo finish
    
skip:


finish:

    CommandState.StartDefaultCommand
    Exit Sub

End Sub
&lt;/pre&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/710264?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 15:05:41 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:4bc0c244-51ef-4416-b813-5ff37482231d</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Hi Andrew,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No dramas at all, this should be possible by changing the oGroup variable to this value and then have the if statement on line 80 check the left characters of oNew match for the number of characters in oGroup. You&amp;#39;ll just need to remove parts of the code that check for data from a selected element.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll see if I can post what that would look like first chance tomorrow or so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/710257?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 14:39:55 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2a2d453e-43b5-470e-8e67-12cf22847ea0</guid><dc:creator>Andrew Wagner</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;
&lt;p&gt;First of all, thanks for sharing this solution! I&amp;#39;m looking at making use of this to remove some annotation groups. However, my issue is that all of my drawing models are in separate DGNs, so I&amp;#39;m going to try to run this with a batch process. This means I won&amp;#39;t be able to select the annotations to be deleted with a mouse click...&lt;/p&gt;
&lt;p&gt;How might I modify the code to&amp;nbsp;target a certain annotation group (e.g. &amp;quot;Design Annotations\XS Edge of Pavement\e6dc4e75-6ea0-4131-91f4-f27c47592154&amp;quot;, but replace the last part of the string with wildcard?) so that the process of selecting an element from a group is bypassed? Can this be done?&lt;/p&gt;
&lt;p&gt;Thanks very much,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/709368?ContentTypeID=1</link><pubDate>Sat, 30 Apr 2022 08:00:57 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:3d59bcc6-651a-40d6-ad14-cfeffbab1316</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;The VBA code below should do what you need. To run:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select an element that was placed in the Annotation group instance you want to remove&lt;/li&gt;
&lt;li&gt;Run the macro below&lt;/li&gt;
&lt;li&gt;It will delete all elements that belonged to the same Annotation group instance in all Drawing models of the active Designfile&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Sub deleteAnnoAll()

    Dim oScanEnumerator As ElementEnumerator, oScanEnumerator0 As ElementEnumerator, ph As PropertyHandler
    Dim oGroupName As String, ph0 As PropertyHandler, oElement As Element, oSelected As Element, oModel As ModelReference

    If ActiveModelReference.Type = msdModelTypeDrawing Then
    
        For Each oModel In ActiveDesignFile.Models
            If oModel.Type = msdModelTypeDrawing Then
                countDrawings = countDrawings + 1
            End If
        Next
        
        If ActiveModelReference.AnyElementsSelected = False Then
            CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
            ShowMessage &amp;quot;ERROR - No elements selected&amp;quot;, , msdMessageCenterPriorityError, True
            GoTo finish
        Else
        
            Set oScanEnumerator0 = ActiveModelReference.GetSelectedElements
            oScanEnumerator0.MoveNext
            Set oSelected = oScanEnumerator0.Current
            
            If oSelected.ModelReference.IsAttachment = False And oSelected.ModelReference.Name = ActiveModelReference.Name Then
                Set ph0 = CreatePropertyHandler(oSelected)
                If ph0.SelectByAccessString(&amp;quot;Groups[0].Description&amp;quot;) = True Then
                    oSearch = InStr(ph0.GetDisplayString, &amp;quot;\&amp;quot;)
                    oGroupName = Left(ph0.GetDisplayString, oSearch)
                    
                    If ph0.GetDisplayString = &amp;quot;&amp;quot; Then
                        CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                        ShowMessage &amp;quot;ERROR - Selected element is not Civil Annotation&amp;quot;, , msdMessageCenterPriorityError, True
                        GoTo finish
                    End If
                Else
                    CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                    ShowMessage &amp;quot;ERROR - Selected element is not Civil Annotation&amp;quot;, , msdMessageCenterPriorityError, True
                    GoTo finish
                End If
 
            Else
                CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
                ShowMessage &amp;quot;ERROR - Only elements in active model can be used for this tool&amp;quot;, , msdMessageCenterPriorityError, True
                GoTo finish
            End If
            
            
            &amp;#39; Save current model name
            &amp;#39;currMod = ActiveModelReference.Name
        
            Dim oScanCriteria As New ElementScanCriteria
        
            &amp;#39; Cycle through models and delete matching annotation group elements
            For Each oModel In ActiveDesignFile.Models
            
                If oModel.Type = msdModelTypeDrawing Then
                    totmodels = totmodels + 1
                    
                    count1 = 0
                    
                    oScanCriteria.IncludeOnlyVisible
                    oScanCriteria.ExcludeNonGraphical
                    
                    Set oScanEnumerator = oModel.Scan(oScanCriteria)
                    oRun = 1
                    
                    &amp;#39;oModel.Activate
                    ShowTempMessage msdStatusBarAreaMiddle, &amp;quot;Processing Drawing model &amp;quot; + CStr(totmodels) + &amp;quot; of &amp;quot; + CStr(countDrawings) + &amp;quot;...&amp;quot;
                    
                    Do While oScanEnumerator.MoveNext
                        Set oElement = oScanEnumerator.Current
                        countTot = countTot + 1
                        If oElement.IsGraphical = True And oElement.ModelReference.Name = oModel.Name And oElement.ModelReference.IsAttachment = False Then
                            Set ph = CreatePropertyHandler(oElement)
                            If ph.SelectByAccessString(&amp;quot;Groups[0].Description&amp;quot;) = True Then
                                oSearch = &amp;quot;&amp;quot;
                                oSearch = InStr(ph.GetDisplayString, &amp;quot;\&amp;quot;)
                                oNew = Left(ph.GetDisplayString, oSearch)
                                                         
                                If StrComp(oNew, oGroupName, vbBinaryCompare) = 0 Then
                                    oModel.RemoveElement oElement
                                    count = count + 1
                                    count1 = count + 1
                                End If
                                
                            End If
                        End If
                    Loop
                
                    If count1 &amp;gt; 0 Then
                        countMod = countMod + 1
                    End If
                    
                End If
                
                Set oElement = Nothing
                Set oModel = Nothing
                Set oScanEnumerator = Nothing
                
            Next
            
            
            &amp;#39; Return to original model
            &amp;#39;ActiveDesignFile.Models(currMod).Activate
            
        
            CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
            If count &amp;gt; 0 Then
                ShowMessage CStr(count) + &amp;quot; total annotation element(s)  deleted from &amp;quot; + CStr(countMod) + &amp;quot; Drawing models.&amp;quot; &amp;amp; vbNewLine &amp;amp; vbNewLine + &amp;quot;Removed Annotation Group: &amp;quot; + vbNewLine + Left(ph0.GetDisplayString, oSearch - 1), , msdMessageCenterPriorityInfo, True
            Else
                ShowMessage &amp;quot;No associated Civil Annotation found in any Drawing models&amp;quot;, , msdMessageCenterPriorityWarning, True
            End If
    
        End If
                    
    Else
    
        CadInputQueue.SendCommand &amp;quot;beep&amp;quot;
        ShowMessage &amp;quot;ERROR - Tool can only be run in a Drawing model&amp;quot;, , msdMessageCenterPriorityError, True
    End If
    
    GoTo finish
    
skip:


finish:

    CommandState.StartDefaultCommand
    Exit Sub

End Sub&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/5922/pastedimage1651305864916v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Individual Annotation Groups</title><link>https://communities.bentley.com/thread/708504?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 09:12:50 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ed7ec04d-5c34-4d6e-a40f-971fd97623fe</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is a way to do this via VBA. As every Annotation Group placement instance has a unique Named Group, you can use vba to get the Named Group from a selected element and delete all elements that are part of the same one. You could then get it to iterate through all Drawing models to delete other instances of it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately no native tools for this...yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>