<?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: GetSubComponentIds cannot get nested familyInstance information in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/getsubcomponentids-cannot-get-nested-familyinstance-information/m-p/7277078#M77005</link>
    <description>&lt;P&gt;GetSubComponentIds() method works for nested families that are shared.&lt;/P&gt;&lt;P&gt;The "doc.EditFamily(famElement)" would get you the desired results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's Jeremy's example:&lt;/P&gt;&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/09/modifying-saving-and-reloading-families.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/09/modifying-saving-and-reloading-families.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code copied from blog post:&lt;/P&gt;&lt;PRE&gt;Document doc = commandData.Application
    .ActiveUIDocument.Document;
 
  FilteredElementCollector collectorUsed
    = new FilteredElementCollector( doc );
 
  collectorUsed.OfClass( typeof( Family ) );
 
  foreach( Family f in collectorUsed )
  {
    string name = f.Name;
    Document famdoc = doc.EditFamily( f );
 
    FilteredElementCollector famcollectorUsed
      = new FilteredElementCollector( famdoc );
 
    ICollection&amp;lt;ElementId&amp;gt; textNoteTypes
      = famcollectorUsed.OfClass( typeof( TextNoteType ) )
        .ToElementIds();
 
    foreach( ElementId textNoteTypeId in textNoteTypes )
    {
      Element ele = doc.GetElement( textNoteTypeId );
      foreach( Parameter p in ele.Parameters )
      {
        if( p.Definition.Name == "Text Font" )
        {
          using( Transaction tranew
            = new Transaction( doc ) )
          {
            tranew.Start( "Update" );
            p.Set( "Arial Black" );
            tranew.Commit();
          }
        }
      }
    }
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2017 14:22:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-08-04T14:22:01Z</dc:date>
    <item>
      <title>GetSubComponentIds cannot get nested familyInstance information</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getsubcomponentids-cannot-get-nested-familyinstance-information/m-p/4978248#M77004</link>
      <description>&lt;P&gt;I use this &amp;nbsp;&lt;A target="_self" href="https://dl.dropboxusercontent.com/u/15562376/63_PHILIPS_cleanroom-LED-layin_f.rfa"&gt;family file&lt;/A&gt;, it has nested lamp, however, I use the follow code to get the nested lamp information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ICollection&amp;lt;ElementId&amp;gt; subElemSet = familyinstance.GetSubComponentIds();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the problem is that subElemSet.count == 0, why I cannot get the lamp information from this family file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other way to get the lamp information?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2014 02:08:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getsubcomponentids-cannot-get-nested-familyinstance-information/m-p/4978248#M77004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-22T02:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: GetSubComponentIds cannot get nested familyInstance information</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getsubcomponentids-cannot-get-nested-familyinstance-information/m-p/7277078#M77005</link>
      <description>&lt;P&gt;GetSubComponentIds() method works for nested families that are shared.&lt;/P&gt;&lt;P&gt;The "doc.EditFamily(famElement)" would get you the desired results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's Jeremy's example:&lt;/P&gt;&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/09/modifying-saving-and-reloading-families.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/09/modifying-saving-and-reloading-families.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code copied from blog post:&lt;/P&gt;&lt;PRE&gt;Document doc = commandData.Application
    .ActiveUIDocument.Document;
 
  FilteredElementCollector collectorUsed
    = new FilteredElementCollector( doc );
 
  collectorUsed.OfClass( typeof( Family ) );
 
  foreach( Family f in collectorUsed )
  {
    string name = f.Name;
    Document famdoc = doc.EditFamily( f );
 
    FilteredElementCollector famcollectorUsed
      = new FilteredElementCollector( famdoc );
 
    ICollection&amp;lt;ElementId&amp;gt; textNoteTypes
      = famcollectorUsed.OfClass( typeof( TextNoteType ) )
        .ToElementIds();
 
    foreach( ElementId textNoteTypeId in textNoteTypes )
    {
      Element ele = doc.GetElement( textNoteTypeId );
      foreach( Parameter p in ele.Parameters )
      {
        if( p.Definition.Name == "Text Font" )
        {
          using( Transaction tranew
            = new Transaction( doc ) )
          {
            tranew.Start( "Update" );
            p.Set( "Arial Black" );
            tranew.Commit();
          }
        }
      }
    }
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 14:22:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getsubcomponentids-cannot-get-nested-familyinstance-information/m-p/7277078#M77005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-04T14:22:01Z</dc:date>
    </item>
  </channel>
</rss>

