BuildingCoder.CmdRelationshipInverter.GetElementIds C# (CSharp) Méthode

GetElementIds() private méthode

From a list of openings, determine the wall hoisting each and return a mapping of element ids from host to all hosted.
private GetElementIds ( FilteredElementCollector elements ) : List>.Dictionary
elements FilteredElementCollector Hosted elements
Résultat List>.Dictionary
        private Dictionary<ElementId, List<ElementId>> GetElementIds( FilteredElementCollector elements )
        {
            Dictionary<ElementId, List<ElementId>> dict =
            new Dictionary<ElementId, List<ElementId>>();

              string fmt = "{0} is hosted by {1}";

              foreach( FamilyInstance fi in elements )
              {
            ElementId id = fi.Id;
            ElementId idHost = fi.Host.Id;

            Debug.Print( fmt,
              Util.ElementDescription( fi ),
              ElementDescription( idHost ) );

            if( !dict.ContainsKey( idHost ) )
            {
              dict.Add( idHost, new List<ElementId>() );
            }
            dict[idHost].Add( id );
              }
              return dict;
        }