<?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: Loading rfa and accessing family instance in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679928#M61992</link>
    <description>&lt;P&gt;Hi again!&lt;/P&gt;
&lt;P&gt;Yes all good, thanks. Hope you are also?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's quite easy (once you know!):&lt;/P&gt;
&lt;PRE&gt;  	Dim symbolIds As ISet(Of DB.ElementId) = family.GetFamilySymbolIds
        Dim doc As DB.Document = family.Document
         For Each id As DB.ElementId In symbolIds
            Dim element As DB.Element = doc.GetElement(id)
            Dim familySymbol As DB.FamilySymbol = TryCast(element, DB.FamilySymbol)
	    'do something with your familySymbol, or store it for later use.
	 Next&lt;/PRE&gt;
&lt;P&gt;If you got an elementId some other way, you should also have to check that the familySymbol object isNot nothing - it may be another element type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Matt&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2016 15:47:37 GMT</pubDate>
    <dc:creator>matthew_taylor</dc:creator>
    <dc:date>2016-11-10T15:47:37Z</dc:date>
    <item>
      <title>Loading rfa and accessing family instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679268#M61989</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using&amp;nbsp;&lt;STRONG&gt;UIApplication.ActiveUIDocument.Document.LoadFamily&lt;/STRONG&gt; to load an *.rfa file into a project and I'm wondering if there is a better way to access the &lt;STRONG&gt;FamilyInstance &lt;/STRONG&gt;and&lt;STRONG&gt; FamilySymbol&lt;/STRONG&gt;&amp;nbsp;of the loaded &lt;STRONG&gt;Family&lt;/STRONG&gt; rather than using a &lt;STRONG&gt;FamilyInstanceFilter&lt;/STRONG&gt; and &lt;STRONG&gt;FilteredElementCollector&lt;/STRONG&gt; and using a &lt;STRONG&gt;foreach&lt;/STRONG&gt; to access these every time a new *.rfa file is loaded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know what I'm doing is inefficient, but I can't think of another way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 12:34:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679268#M61989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-10T12:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Loading rfa and accessing family instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679334#M61990</link>
      <description>&lt;P&gt;Hi Adam,&lt;/P&gt;
&lt;P&gt;If you're just wanting the symbol use loadFamilySymbol..&lt;/P&gt;
&lt;P&gt;If you have loaded the family, and have the family object (it can be passed byref - to use vb.net terminology), you can use family.GetFamilySymbolIds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Matt&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 12:59:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679334#M61990</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2016-11-10T12:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loading rfa and accessing family instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679892#M61991</link>
      <description>&lt;P&gt;Hello again Matthew, hope you are well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yeah I've tried &lt;STRONG&gt;LoadFamilySymbol&lt;/STRONG&gt;, but that is only useful in instances where the name/type of the symbol is already known.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use &lt;STRONG&gt;GetFamilySymbolIds&lt;/STRONG&gt;,&amp;nbsp;would it be possible to create a separate &lt;STRONG&gt;FamilySymbol&lt;/STRONG&gt; variable for each ID?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 15:39:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679892#M61991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-10T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Loading rfa and accessing family instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679928#M61992</link>
      <description>&lt;P&gt;Hi again!&lt;/P&gt;
&lt;P&gt;Yes all good, thanks. Hope you are also?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's quite easy (once you know!):&lt;/P&gt;
&lt;PRE&gt;  	Dim symbolIds As ISet(Of DB.ElementId) = family.GetFamilySymbolIds
        Dim doc As DB.Document = family.Document
         For Each id As DB.ElementId In symbolIds
            Dim element As DB.Element = doc.GetElement(id)
            Dim familySymbol As DB.FamilySymbol = TryCast(element, DB.FamilySymbol)
	    'do something with your familySymbol, or store it for later use.
	 Next&lt;/PRE&gt;
&lt;P&gt;If you got an elementId some other way, you should also have to check that the familySymbol object isNot nothing - it may be another element type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Matt&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 15:47:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679928#M61992</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2016-11-10T15:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Loading rfa and accessing family instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679980#M61993</link>
      <description>&lt;P&gt;All good here too thanks,&amp;nbsp;apart from the occasional Revit API woe!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excellent, that looks easy enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks once again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 15:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679980#M61993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-10T15:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Loading rfa and accessing family instance</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679995#M61994</link>
      <description>&lt;P&gt;No problem. Best of luck with your app!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Matt&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 16:03:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loading-rfa-and-accessing-family-instance/m-p/6679995#M61994</guid>
      <dc:creator>matthew_taylor</dc:creator>
      <dc:date>2016-11-10T16:03:12Z</dc:date>
    </item>
  </channel>
</rss>

