<?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: Rebar TAG Selection in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192642#M27090</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;OfCategory method requires &lt;A href="https://www.revitapidocs.com/2020/ba1c5b30-242f-5fdc-8ea9-ec3b61e6e722.htm" target="_self"&gt;BuiltInCategory&lt;/A&gt; enumeration. In your case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;OfCategory(BuiltInCategory.OST_MultiReferenceAnnotations)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 27 Mar 2021 21:16:27 GMT</pubDate>
    <dc:creator>architect.bim</dc:creator>
    <dc:date>2021-03-27T21:16:27Z</dc:date>
    <item>
      <title>Rebar TAG Selection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192597#M27089</link>
      <description>&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a collection of all MultiReferenceAnnotations like the tag with 139&lt;/P&gt;&lt;P&gt;With Revitlookup I found that the id&amp;nbsp; of this annotation is -2000970&lt;/P&gt;&lt;P&gt;I tried the code below but the collection is nothing.&lt;/P&gt;&lt;P&gt;If I try to collect rebar tags (-2009020) like tag with 174, with the some code, work fine&lt;/P&gt;&lt;P&gt;Where I wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Immagine 2021-03-27 214805.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/899324i5A3F3BD1E5DB178B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine 2021-03-27 214805.png" alt="Immagine 2021-03-27 214805.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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 tagColl As List(Of Element) = New FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(-2000970).Where(Function(x) TypeOf x Is IndependentTag).ToList()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 20:59:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192597#M27089</guid>
      <dc:creator>stefano.cartaKGT96</dc:creator>
      <dc:date>2021-03-27T20:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rebar TAG Selection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192642#M27090</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;OfCategory method requires &lt;A href="https://www.revitapidocs.com/2020/ba1c5b30-242f-5fdc-8ea9-ec3b61e6e722.htm" target="_self"&gt;BuiltInCategory&lt;/A&gt; enumeration. In your case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;OfCategory(BuiltInCategory.OST_MultiReferenceAnnotations)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 27 Mar 2021 21:16:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192642#M27090</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-03-27T21:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rebar TAG Selection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192669#M27091</link>
      <description>&lt;P&gt;Hi Maxim&lt;/P&gt;&lt;P&gt;Thanks for your quickly replay..&lt;/P&gt;&lt;P&gt;I will try it tomorrow...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 21:36:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10192669#M27091</guid>
      <dc:creator>stefano.cartaKGT96</dc:creator>
      <dc:date>2021-03-27T21:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rebar TAG Selection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10193453#M27092</link>
      <description>&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;I modified my code with "BuiltInCategory.OST_MultiReferenceAnnotations" but tagcoll is empty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim tavTAG As Boolean = Revit.ED_Utility.ElementIsTagged1(doc, ele, (BuiltInCategory.OST_MultiReferenceAnnotations), (BuiltInCategory.OST_Rebar))


  Public Shared Function ElementIsTagged1(ByVal doc As Document, ByVal ele As Element, ByVal eleTag As BuiltInCategory, ByVal eleElements As BuiltInCategory) As Boolean
            Dim tagColl As List(Of Element) = New FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(eleTag).Where(Function(x) TypeOf x Is IndependentTag).ToList()
            Dim eleColl As List(Of Element) = New FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(eleElements).ToList()
            Dim ids As List(Of ElementId) = New List(Of ElementId)()

            For Each e As Element In tagColl
                Dim tag As IndependentTag = TryCast(e, IndependentTag)
                Dim id As ElementId = tag.TaggedLocalElementId
                Dim aux1 As Integer = tag.TaggedLocalElementId.IntegerValue
                Dim aux2 As Boolean = ids.Contains(tag.TaggedLocalElementId)

                If (tag.TaggedLocalElementId.IntegerValue &amp;lt;&amp;gt; -1) AndAlso (ids.Contains(tag.TaggedLocalElementId) = False) Then
                    ids.Add(tag.TaggedLocalElementId)
                End If
            Next

            Dim uniqueIds As List(Of ElementId) = ids.Distinct().ToList()
            Dim eleIds As List(Of ElementId) = New List(Of ElementId)()

            For Each e As Element In eleColl
                eleIds.Add(e.Id)
            Next

            Dim idEleTag As List(Of ElementId) = New List(Of ElementId)()

            For Each id As ElementId In eleIds

                If uniqueIds.Contains(id) Then
                    idEleTag.Add(id)
                End If
            Next

            If idEleTag.Contains(ele.Id) Then
                Return True
            Else
                Return False
            End If
        End Function&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 28 Mar 2021 11:56:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10193453#M27092</guid>
      <dc:creator>stefano.cartaKGT96</dc:creator>
      <dc:date>2021-03-28T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rebar TAG Selection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10193495#M27093</link>
      <description>&lt;P&gt;Sorry, maybe I misunderstand the problem but in fact if you need to select all multireference annotations on view you can use either OfClass or OfCategory method. In both cases you get the same results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Python code
tags_of_class = FilteredElementCollector(doc, doc.ActiveView.Id) \
    .OfClass(DB.MultiReferenceAnnotation)

tags_of_category = FilteredElementCollector(doc, doc.ActiveView.Id) \
    .OfCategory(DB.BuiltInCategory.OST_MultiReferenceAnnotations) \
    .WhereElementIsNotElementType()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The elements you try to get do not belong to IndependendTag class. I think in your code the problem is there.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2021 12:36:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-tag-selection/m-p/10193495#M27093</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-03-28T12:36:07Z</dc:date>
    </item>
  </channel>
</rss>

