<?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: how  to verify label on element using revit api? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598220#M44206</link>
    <description>&lt;P&gt;but how to collect tags tried this one but not getting collect.&lt;/P&gt;
&lt;P&gt;IEnumerable&amp;lt;Element&amp;gt; roomTags = new FilteredElementCollector(activeDoc, activeDoc.ActiveView.Id).OfCategory(BuiltInCategory.OST_RoomTags).WhereElementIsNotElementType().ToElements();&lt;/P&gt;
&lt;P&gt;is this right?&lt;/P&gt;
&lt;P&gt;or sholud try something else?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Feb 2019 10:35:50 GMT</pubDate>
    <dc:creator>prasannamurumkar</dc:creator>
    <dc:date>2019-02-15T10:35:50Z</dc:date>
    <item>
      <title>how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8594801#M44200</link>
      <description>&lt;P&gt;hook is present in bathroom in given project.&lt;/P&gt;
&lt;P&gt;Now wants to verify whether this hook is labeled by"HK" using revit api?&lt;/P&gt;
&lt;P&gt;how do we that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 04:39:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8594801#M44200</guid>
      <dc:creator>prasannamurumkar</dc:creator>
      <dc:date>2019-02-14T04:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8596718#M44201</link>
      <description>&lt;P&gt;Assuming your question is about Tags (IndependentTag class in Revit API): tags are dependents of model elements. This means if you delete&amp;nbsp;the element they will be deleted, then you can retrieve the tag ElementId and Rollback the transaction. Then retrieve the TagText property of the tag and compare it to "HK" or anything else.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:25:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8596718#M44201</guid>
      <dc:creator>BardiaJahan</dc:creator>
      <dc:date>2019-02-14T18:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597653#M44202</link>
      <description>&lt;P&gt;Thank you for reply.&lt;/P&gt;
&lt;P&gt;1.able to retrive tag&lt;/P&gt;
&lt;P&gt;var doortag = new HashSet&amp;lt;ElementId&amp;gt;(collector1.OfClass(typeof(IndependentTag)).OfCategory(BuiltInCategory.OST_DoorTags).OfType&amp;lt;IndependentTag&amp;gt;().Select(x =&amp;gt; x.GetTaggedLocalElement().Id).Where(x =&amp;gt; x != null));&lt;/P&gt;
&lt;P&gt;2.Able to retrive ElementID of tags.&lt;/P&gt;
&lt;P&gt;foreach (ElementId i in doortag)&lt;/P&gt;
&lt;P&gt;3.How to retrive Tag text property and how to compare with any particular name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you give code for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 04:04:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597653#M44202</guid>
      <dc:creator>prasannamurumkar</dc:creator>
      <dc:date>2019-02-15T04:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597683#M44203</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6900801"&gt;@prasannamurumkar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I hope this will help&lt;/P&gt;
&lt;PRE&gt;foreach(ElementId eid in tagElementIds)
                {
                    Element e = doc.GetElement(eid);
                    IndependentTag Doortag = e as IndependentTag;
                    if(Doortag!=null)
                    {
                       if(Doortag.TagText=="Name to compare")
                       {
                            //Your code
                       }
                    }
                }&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 04:38:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597683#M44203</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2019-02-15T04:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597716#M44204</link>
      <description>&lt;PRE&gt; Element e = doc.GetElement(eid);&lt;/PRE&gt;
&lt;P&gt;able to get element.For this&lt;/P&gt;
&lt;PRE&gt; IndependentTag Doortag = e as IndependentTag;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Doortag is showing null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 05:19:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597716#M44204</guid>
      <dc:creator>prasannamurumkar</dc:creator>
      <dc:date>2019-02-15T05:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597850#M44205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6900801"&gt;@prasannamurumkar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Your code collects the door not the door tag.&lt;/P&gt;
&lt;P&gt;You can't cast door as independent tag.&lt;/P&gt;
&lt;P&gt;Collect all doortags not doors and from the collected doortags try to get the tagtext.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 06:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8597850#M44205</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2019-02-15T06:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598220#M44206</link>
      <description>&lt;P&gt;but how to collect tags tried this one but not getting collect.&lt;/P&gt;
&lt;P&gt;IEnumerable&amp;lt;Element&amp;gt; roomTags = new FilteredElementCollector(activeDoc, activeDoc.ActiveView.Id).OfCategory(BuiltInCategory.OST_RoomTags).WhereElementIsNotElementType().ToElements();&lt;/P&gt;
&lt;P&gt;is this right?&lt;/P&gt;
&lt;P&gt;or sholud try something else?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 10:35:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598220#M44206</guid>
      <dc:creator>prasannamurumkar</dc:creator>
      <dc:date>2019-02-15T10:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598388#M44207</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6900801"&gt;@prasannamurumkar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here the question is which tags you want to collect?&lt;/P&gt;
&lt;P&gt;Do you want to collect Roomtags or DoorTags?&lt;/P&gt;
&lt;P&gt;this code will help you to collect &lt;STRONG&gt;RoomTags&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt; FilteredElementCollector Collector = new FilteredElementCollector(doc,doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_RoomTags).WhereElementIsNotElementType();
                IList&amp;lt;ElementId&amp;gt; eids = Collector.ToElementIds() as IList&amp;lt;ElementId&amp;gt;;
                
                foreach(ElementId eid in eids)
                {
                    Element e = doc.GetElement(eid);
                    RoomTag IT = e as RoomTag;
                    string s=IT.TagText;
                }&lt;/PRE&gt;
&lt;P&gt;and this code will help you to collect &lt;STRONG&gt;DoorTags&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;FilteredElementCollector Collector = new FilteredElementCollector(doc,doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_DoorTags).WhereElementIsNotElementType();
                IList&amp;lt;ElementId&amp;gt; eids = Collector.ToElementIds() as IList&amp;lt;ElementId&amp;gt;;
                
                foreach(ElementId eid in eids)
                {
                    Element e = doc.GetElement(eid);
                    IndependentTag IT = e as IndependentTag;
                     string s=IT.TagText;
                }&lt;/PRE&gt;
&lt;P&gt;I tested the above codes and both are working fine for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 11:50:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598388#M44207</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2019-02-15T11:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598438#M44208</link>
      <description>&lt;P&gt;thank you it works fine.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 12:17:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8598438#M44208</guid>
      <dc:creator>prasannamurumkar</dc:creator>
      <dc:date>2019-02-15T12:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8602086#M44210</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do we able to get relation between tag and its element?&lt;/P&gt;
&lt;P&gt;as in above case&amp;nbsp; able to get independent tags of particular category.&lt;/P&gt;
&lt;P&gt;for eg having 6 doors got 6 door tags in above case&lt;/P&gt;
&lt;P&gt;suppose one of door does not have tag then it should able to find particular door does not having tag.&lt;/P&gt;
&lt;P&gt;so it is require find relation between element category and element tag category.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 06:55:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8602086#M44210</guid>
      <dc:creator>prasannamurumkar</dc:creator>
      <dc:date>2019-02-18T06:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: how  to verify label on element using revit api?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8602378#M44211</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6900801"&gt;@prasannamurumkar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;try using the below code&lt;/P&gt;
&lt;P&gt;this code will highlight the elements which are not taggged&lt;/P&gt;
&lt;PRE&gt;IList&amp;lt;ElementId&amp;gt; ElementsWithoutTag = new List&amp;lt;ElementId&amp;gt;();

                foreach(Element e in new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).OfClass(typeof(FamilyInstance)))
                {
                    if(new FilteredElementCollector(doc).OfClass(typeof(IndependentTag)).Cast&amp;lt;IndependentTag&amp;gt;().FirstOrDefault(q=&amp;gt;q.TaggedLocalElementId==e.Id)==null)
                    {
                        ElementsWithoutTag.Add(e.Id);
                    }
                }&lt;BR /&gt; uidoc.Selection.SetElementIds(ElementsWithoutTag);&lt;BR /&gt;uidoc.RefreshActiveView();&lt;/PRE&gt;
&lt;P&gt;If this helped solve your problem please mark it as solution, so other users can get this solutions as well&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 09:25:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-verify-label-on-element-using-revit-api/m-p/8602378#M44211</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2019-02-18T09:25:31Z</dc:date>
    </item>
  </channel>
</rss>

