I have created a sphere solid and want to detect is it clashing with wall:
wall = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WherePasses(ElementIntersectsSolidFilter(solid)).FirstElement()
However I got an empty list of wall, does any one know why?
I tried bimorph in dynamo too, but seems it doesn’t detect any wall too?
1 Like
@newshunhk , hi
Your Wall has also become a geometry to clash with your sphere! they have to be equal opponents …
KR
Andreas
strange, if I move the sphere closer then it is possible to detect the wall…
Spherical solids aren’t supported by the Revit API ElementIntersectsSolidFilter so you’ll see intermittent or zero results. I’ve not tried the following before but it might be worth checking if its a workaround:
- Tesselate the sphere.
- Convert it to solid via ShapeBuilder.
- Attempt the intersection using the resultant solid.
3 Likes
thanks,
by the way what is the best way to check is there a wall beside a stairrun?
I changed
ElementIntersectsSolidFilter
to
BoundingBoxIntersectsFilter to detect any walls near the stair
which also change from slow filter to quick filter, and no longer need to create solid. It is much faster and everything works fine now!