예제 #1
0
        private void Stream( ArrayList data, FamilyInstance famInst )
        {
            data.Add( new Snoop.Data.ClassSeparator( typeof( FamilyInstance ) ) );

              data.Add( new Snoop.Data.Object( "Host", famInst.Host ) );
              data.Add( new Snoop.Data.Object( "Symbol", famInst.Symbol ) );

              data.Add( new Snoop.Data.OriginalInstanceGeometry( "Original Geometry", famInst, m_app.Application ) );

              try
              {
            data.Add( new Snoop.Data.Enumerable( "Sub components", famInst.GetSubComponentIds(), famInst.Document ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Sub components", ex ) );
              }

              try
              {
            data.Add( new Snoop.Data.Object( "Super component", famInst.SuperComponent ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Super component", ex ) );
              }

              try
              {
            data.Add( new Snoop.Data.Object( "Room", famInst.Room ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Room", ex ) );
              }

              try
              {
            data.Add( new Snoop.Data.Object( "From room", famInst.FromRoom ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "From room", ex ) );
              }

              try
              {
            data.Add( new Snoop.Data.Object( "To room", famInst.ToRoom ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "To room", ex ) );
              }

              data.Add( new Snoop.Data.Enumerable( "Material", famInst.GetMaterialIds( false ), famInst.Document ) );
              try
              {
            data.Add( new Snoop.Data.Object( "Space", famInst.Space ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Space", ex ) );
              }
              FilteredElementCollector filter = new FilteredElementCollector( famInst.Document );
              IList<Element> phases = filter.OfClass( typeof( Phase ) ).ToElements();
              foreach( Element e in phases )
              {
            try
            {
              data.Add( new Snoop.Data.Object( "get_Space(" + e.Name + ")", famInst.get_Space( e as Phase ) ) );
            }
            catch( Exception ex )
            {
              data.Add( new Snoop.Data.Exception( "get_Space(" + e.Name + ")", ex ) );
            }
              }
              data.Add( new Snoop.Data.String( "Structural type", famInst.StructuralType.ToString() ) );

              // TBD: throws an exception if not the right type!
              try
              {
            data.Add( new Snoop.Data.String( "Structural usage", famInst.StructuralUsage.ToString() ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Structural usage", ex ) );
              }

              data.Add( new Snoop.Data.String( "StructuralMaterialType", famInst.StructuralMaterialType.ToString() ) );
              data.Add( new Snoop.Data.ElementId( "StructuralMaterialId", famInst.StructuralMaterialId, famInst.Document ) );

              data.Add( new Snoop.Data.Object( "MEP model", famInst.MEPModel ) );

              data.Add( new Snoop.Data.Bool( "Can flip facing", famInst.CanFlipFacing ) );
              data.Add( new Snoop.Data.Bool( "Facing flipped", famInst.FacingFlipped ) );
              data.Add( new Snoop.Data.Bool( "Can flip hand", famInst.CanFlipHand ) );
              data.Add( new Snoop.Data.Bool( "Hand flipped", famInst.HandFlipped ) );
              data.Add( new Snoop.Data.Bool( "Can rotate", famInst.CanRotate ) );
              data.Add( new Snoop.Data.Xyz( "Facing orientation", famInst.FacingOrientation ) );
              data.Add( new Snoop.Data.Xyz( "Hand orientation", famInst.HandOrientation ) );
              data.Add( new Snoop.Data.Object( "Location", famInst.Location ) );
              data.Add( new Snoop.Data.Bool( "Mirrored", famInst.Mirrored ) );
              data.Add( new Snoop.Data.Enumerable( "Copings", famInst.GetCopingIds(), famInst.Document ) );

              AnnotationSymbol annoSym = famInst as AnnotationSymbol;
              if( annoSym != null )
              {
            Stream( data, annoSym );
            return;
              }

              Panel panel = famInst as Panel;
              if( panel != null )
              {
            Stream( data, panel );
            return;
              }

              Mullion mullion = famInst as Mullion;
              if( mullion != null )
              {
            Stream( data, mullion );
            return;
              }
        }