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;
        }