pyRevit

Code
Library
Is Point Inside Solid
#✂️ Function to check if point is inside a solid
def is_point_inside_solid(point, solid):
# Create a tiny line from Point
line = Line.CreateBound(point, XYZ(point.X, point.Y, point.Z + 0.01)) # Create Tiny Line
tolerance = 0.00001
# Create Intersection Options
opts = SolidCurveIntersectionOptions()
opts.ResultType = SolidCurveIntersectionMode.CurveSegmentsInside
# Intersect Line with Geometry
sci = solid.IntersectWithCurve(line, opts)
if sci:
return True
#👇 InCase you want to investigate the intersection.
#for i,x in enumerate(sci):
# curve = sci.GetCurveSegment(i)
# pt_start = curve.GetEndPoint(0)
# pt_end = curve.GetEndPoint(1)
#
# if point.IsAlmostEqualTo(pt_start, tolerance) or point.IsAlmostEqualTo(pt_end, tolerance):
# return True

⌨️ Happy Coding!
Erik Frits