Dear Bryan,
Geometry.BoundingBoxXYZContains is not a standard Revit API method, as far as I know, and never was.
Probably it was implemented by someone as a custom extension method along the lines suggested by scottwilson3525.
Here is a sample implementation of a suitable comparison operator for the XYZ point class:
const double _eps = 1.0e-9;
public static bool IsZero(
double a,
double tolerance )
{
return tolerance > Math.Abs( a );
}
public static bool IsZero( double a )
{
return IsZero( a, _eps );
}
public static bool IsEqual( double a, double b )
{
return IsZero( b - a );
}
public static int Compare( double a, double b )
{
return IsEqual( a, b ) ? 0 : ( a < b ? -1 : 1 );
}
public static int Compare( XYZ p, XYZ q )
{
int d = Compare( p.X, q.X );
if( 0 == d )
{
d = Compare( p.Y, q.Y );
if( 0 == d )
{
d = Compare( p.Z, q.Z );
}
}
return d;
}
public static bool IsEqual( XYZ p, XYZ q )
{
return 0 == Compare( p, q );
}
Now you can implement BoundingBoxXyzContains like this:
/// <summary>
/// Return true if the given bounding box bb
/// contains the given point p in its interior.
/// </summary>
public bool BoundingBoxXyzContains(
BoundingBoxXYZ bb,
XYZ p )
{
return 0 < Compare( bb.Min, p )
&& 0 < Compare( p, bb.Max );
}
I'm unable to say anything about all the room placement errors you are getting, though. Sorry.
That's out of the scope of this thread, anyway 🙂
I hope this helps anyway.
Best regards,
Jeremy