<?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: Find Multi-Rebar Annotation Rebar elements in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/11844805#M31275</link>
    <description>&lt;P&gt;Does not work in Revit 2023. They destroyed Multi-Rebar annotation API. I cant select host of a multi-rebar annotations anymore using scripts.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2023 11:39:19 GMT</pubDate>
    <dc:creator>tom.slasletten</dc:creator>
    <dc:date>2023-03-24T11:39:19Z</dc:date>
    <item>
      <title>Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/9790677#M31272</link>
      <description>&lt;P&gt;How can I get the rebar elements which were used for creating Multi-Rebar Annotation? The purpose is to find rebar elements with&amp;nbsp;Multi-Rebar Annotation with not set tag. I can find all Rebar elements using&amp;nbsp;FilteredElementCollector with filtering by Category (BuiltInCategory.OST_Rebar) and also&amp;nbsp;Multi-Rebar Annotation elements (BuiltInCategory.OST_MultiReferenceAnnotations) but&amp;nbsp;how to find a connection between them?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 07:02:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/9790677#M31272</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-08T07:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/9790841#M31273</link>
      <description>&lt;P&gt;Using Revit Lookup, you can easily find this connection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the selected MultiRefenceAnnotation, you can get the dimension in use. Then, you can get a list of References from the Dimension.References. Each of these references refers to a rebar of the tagged rebar set.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 08:36:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/9790841#M31273</guid>
      <dc:creator>longt61</dc:creator>
      <dc:date>2020-10-08T08:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/9790873#M31274</link>
      <description>&lt;P&gt;Thank you very much, it was easier then I assumed.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 08:49:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/9790873#M31274</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-08T08:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/11844805#M31275</link>
      <description>&lt;P&gt;Does not work in Revit 2023. They destroyed Multi-Rebar annotation API. I cant select host of a multi-rebar annotations anymore using scripts.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 11:39:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/11844805#M31275</guid>
      <dc:creator>tom.slasletten</dc:creator>
      <dc:date>2023-03-24T11:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/13419246#M31276</link>
      <description>&lt;P&gt;perfectly working for 2022 thank you so much&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 14:10:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/13419246#M31276</guid>
      <dc:creator>aysenakahraman98</dc:creator>
      <dc:date>2025-04-10T14:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/13420852#M31277</link>
      <description>&lt;P&gt;Here is a code I got from Autodesk to workaround this issue:&amp;nbsp;&lt;/P&gt;&lt;P&gt;// This is a Document Macro that iterates through all MultiReferenceAnnotation elements in the document&lt;BR /&gt;// and collects the referenced rebar elements for MultiReferenceAnnotation elements that contain tag.&lt;BR /&gt;public void SelectRebarSetsTaggedWithMRA()&lt;BR /&gt;{&lt;BR /&gt;FilteredElementCollector fec = new FilteredElementCollector(Document).OfClass(typeof(MultiReferenceAnnotation));&lt;BR /&gt;for(FilteredElementIterator iter = fec.GetElementIterator(); !iter.IsDone(); iter.MoveNext())&lt;BR /&gt;{&lt;BR /&gt;MultiReferenceAnnotation MRA = iter.Current as MultiReferenceAnnotation;&lt;BR /&gt;if(MRA == null)&lt;BR /&gt;continue;&lt;BR /&gt;&lt;BR /&gt;// if the MRA has no tag not interested&lt;BR /&gt;if(MRA.TagId == ElementId.InvalidElementId)&lt;BR /&gt;continue;&lt;BR /&gt;&lt;BR /&gt;Dimension dimension = Document.GetElement(MRA.DimensionId) as Dimension;&lt;BR /&gt;if(dimension == null)&lt;BR /&gt;continue;&lt;BR /&gt;&lt;BR /&gt;MultiReferenceAnnotationType mraType = Document.GetElement(MRA.GetTypeId()) as MultiReferenceAnnotationType;&lt;BR /&gt;if(mraType == null)&lt;BR /&gt;continue;&lt;BR /&gt;&lt;BR /&gt;// this is always OST_Rebar&lt;BR /&gt;ElementId referenceCategoryId = mraType.ReferenceCategoryId;&lt;BR /&gt;&lt;BR /&gt;// get the dimension references&lt;BR /&gt;ReferenceArray dimRefs = dimension.References;&lt;BR /&gt;&lt;BR /&gt;// append the element ids referenced by the dimension if the element category id mathches the reference category id from the MultiReferenceAnnotationType&lt;BR /&gt;HashSet&amp;lt;ElementId&amp;gt; rebarIds = new HashSet&amp;lt;ElementId&amp;gt;();&lt;BR /&gt;foreach (Reference reference in dimRefs)&lt;BR /&gt;{&lt;BR /&gt;Element elem = Document.GetElement(reference.ElementId);&lt;BR /&gt;if(elem == null)&lt;BR /&gt;continue;&lt;BR /&gt;&lt;BR /&gt;if(elem.Category.Id == referenceCategoryId)&lt;BR /&gt;rebarIds.Add(elem.Id);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// the needed ids for the current MRA element are in the rebarIds, do whatever you need to do with them&lt;BR /&gt;Selection selection = Application.ActiveUIDocument.Selection;&lt;BR /&gt;selection.SetElementIds(rebarIds);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 10:21:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/13420852#M31277</guid>
      <dc:creator>tom.slasletten</dc:creator>
      <dc:date>2025-04-11T10:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find Multi-Rebar Annotation Rebar elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/13420866#M31278</link>
      <description>&lt;P&gt;From this code from Autodesk I managed to create a pyRevit script that isolatestemporary untagged rebars if they are tagged with MRA or independent tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import clr&lt;BR /&gt;clr.AddReference('RevitAPI')&lt;BR /&gt;from Autodesk.Revit.DB import FilteredElementCollector, MultiReferenceAnnotation, IndependentTag, ElementId, Dimension, BuiltInCategory, Transaction&lt;BR /&gt;from System.Collections.Generic import List&lt;/P&gt;&lt;P&gt;uidoc = __revit__.ActiveUIDocument&lt;BR /&gt;doc = __revit__.ActiveUIDocument.Document&lt;BR /&gt;view = doc.ActiveView&lt;/P&gt;&lt;P&gt;def TemporarilyIsolateRebarSetsNotTaggedWithMRAorIndependentTag():&lt;BR /&gt;fec = FilteredElementCollector(doc).OfClass(MultiReferenceAnnotation)&lt;BR /&gt;mraIds = set()&lt;BR /&gt;for MRA in fec:&lt;BR /&gt;if MRA is None:&lt;BR /&gt;continue&lt;/P&gt;&lt;P&gt;if MRA.TagId == ElementId.InvalidElementId:&lt;BR /&gt;continue&lt;/P&gt;&lt;P&gt;dimension = doc.GetElement(MRA.DimensionId)&lt;BR /&gt;if dimension is None:&lt;BR /&gt;continue&lt;/P&gt;&lt;P&gt;mraType = doc.GetElement(MRA.GetTypeId())&lt;BR /&gt;if mraType is None:&lt;BR /&gt;continue&lt;/P&gt;&lt;P&gt;referenceCategoryId = mraType.ReferenceCategoryId&lt;BR /&gt;dimRefs = dimension.References&lt;BR /&gt;for reference in dimRefs:&lt;BR /&gt;elem = doc.GetElement(reference.ElementId)&lt;BR /&gt;if elem is None:&lt;BR /&gt;continue&lt;/P&gt;&lt;P&gt;if elem.Category.Id == referenceCategoryId:&lt;BR /&gt;mraIds.add(elem.Id)&lt;/P&gt;&lt;P&gt;all_rebar_element_ids = set([element.Id for element in FilteredElementCollector(doc, view.Id).OfCategory(BuiltInCategory.OST_Rebar)])&lt;BR /&gt;non_mra_rebar_element_ids = all_rebar_element_ids - mraIds&lt;/P&gt;&lt;P&gt;independentTagIds = set()&lt;BR /&gt;for independentTag in FilteredElementCollector(doc, view.Id).OfClass(IndependentTag):&lt;BR /&gt;independentTagIds.update([id for id in independentTag.GetTaggedLocalElementIds()])&lt;/P&gt;&lt;P&gt;non_mra_or_independent_tag_rebar_element_ids = non_mra_rebar_element_ids - independentTagIds&lt;/P&gt;&lt;P&gt;with Transaction(doc, 'Temporarily Isolate Untagged Rebars') as t:&lt;BR /&gt;t.Start()&lt;BR /&gt;view.IsolateElementsTemporary(List[ElementId](non_mra_or_independent_tag_rebar_element_ids))&lt;BR /&gt;t.Commit()&lt;/P&gt;&lt;P&gt;TemporarilyIsolateRebarSetsNotTaggedWithMRAorIndependentTag()&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 10:20:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-multi-rebar-annotation-rebar-elements/m-p/13420866#M31278</guid>
      <dc:creator>tom.slasletten</dc:creator>
      <dc:date>2025-04-11T10:20:37Z</dc:date>
    </item>
  </channel>
</rss>

