<?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: Setting the default ID of a system text using API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6632846#M62484</link>
    <description>&lt;P&gt;Many thanks Jim! Will try to amend the codes then see how it goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated,&lt;/P&gt;&lt;P&gt;Wil&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2016 19:24:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-10-19T19:24:58Z</dc:date>
    <item>
      <title>Setting the default ID of a system text using API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6617084#M62482</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a newbie in Revit API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just wondering how to set the default ID for a system text families. I used the link below for the similar scenario but this can only access loadable families:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/set-default-family-type-id-for-my-room-tag/m-p/5555472/highlight/true#M9237" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/set-default-family-type-id-for-my-room-tag/m-p/5555472/highlight/true#M9237&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the updated code that supposed to set the system text ID.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;FilteredElementCollector&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; collector = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;FilteredElementCollector&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(doc);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;collector = collector.OfClass(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;typeof&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;TextNote&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; query = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;from&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; element &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; collector &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; element.Name == &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"Text-3.0mm-Dot-O"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; element;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;List&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Element&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt; famSyms = query.ToList&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Element&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt;();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementId&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; symbolId = famSyms[0].Id;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;FamilyInstanceFilter&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; filter = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;FamilyInstanceFilter&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(doc, symbolId);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;collector = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;FilteredElementCollector&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(doc);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ICollection&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Element&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt; familyInstances = collector.WherePasses(filter).ToElements();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementId&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; txId = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementId&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;BuiltInCategory&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.OST_TextNotes);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;doc.SetDefaultFamilyTypeId(txId, symbolId);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated,&lt;/P&gt;&lt;P&gt;Wil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 10:51:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6617084#M62482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-12T10:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default ID of a system text using API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6625386#M62483</link>
      <description>&lt;P&gt;Dear Wilfredo Mayo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, the Document.SetDefaultFamilyTypeId(...) requires one family type for second method parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that your code below has some problem on family type retrieval:&lt;/P&gt;
&lt;PRE&gt;FilteredElementCollector collector = new FilteredElementCollector(doc);
collector = collector.OfClass(typeof(TextNote)); // This is instance, it's incorrect&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The correct code should be:&lt;/P&gt;
&lt;PRE&gt;FilteredElementCollector collector = new FilteredElementCollector(doc);
collector = collector.OfClass(typeof(TextNoteType)); // family type is correct&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2016 15:28:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6625386#M62483</guid>
      <dc:creator>JimJia</dc:creator>
      <dc:date>2016-10-16T15:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default ID of a system text using API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6632846#M62484</link>
      <description>&lt;P&gt;Many thanks Jim! Will try to amend the codes then see how it goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated,&lt;/P&gt;&lt;P&gt;Wil&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 19:24:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6632846#M62484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-19T19:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the default ID of a system text using API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6659012#M62485</link>
      <description>&lt;P&gt;Apologies for not&amp;nbsp;coming back soon. This works a fortune! Thanks a lot Jim for your valuable time to help newbies like me...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 01:59:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-the-default-id-of-a-system-text-using-api/m-p/6659012#M62485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-01T01:59:27Z</dc:date>
    </item>
  </channel>
</rss>

