BuildingCoder.CmdColumnRound.GetElementHeightFromBoundingBox C# (CSharp) 메소드

GetElementHeightFromBoundingBox() 공개 메소드

Determine the height of any given element from its bounding box.
public GetElementHeightFromBoundingBox ( Element e ) : Double
e Element
리턴 Double
        public Double GetElementHeightFromBoundingBox( 
            Element e)
        {
            // No need to retrieve the full element geometry.
              // Even if there were, there would be no need to
              // compute references, because they will not be
              // used anyway!

              //GeometryElement ge = e.get_Geometry(
              //  new Options() {
              //    ComputeReferences = true } );
              //
              //BoundingBoxXYZ boundingBox = ge.GetBoundingBox();

              BoundingBoxXYZ bb = e.get_BoundingBox( null );

              if( null == bb )
              {
            throw new ArgumentException(
              "Expected Element 'e' to have a valid bounding box." );
              }

              return bb.Max.Z - bb.Min.Z;
        }