![](/skins/images/0A49DF8D19834AF5AD7924AE3F4E040E/responsive_peak/images/icon_anonymous_message.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings,
Im having a problem with the BoundingBoxIntersectsFilter returning elements of which do not appear to intersect with the BoundingBox. Using a BoundingBoxIntersectsFilter from BoundingBox created from endpoints 0 and 1 from conduit A below, always returns intersecting with conduit B shown below.
In this case, I am using conduit.Location.Curve.GetEndpoint() to get point 0 and 1 from conduit A. Then I create an Outline from each of those points like so, Outline(point0, point0), and Outline(point1, point1)
After running the FilteredElementCollector i receive the expected elements in addition to the unexpected conduit B.
I resorted to looping through all of the elements returned and using conduitPoint0or1.DistanceTo(returned elements point) and then removing any from the list that are more than x distance and this conduit B always comes up as intersecting. No matter how low i make the distance, the FilteredElementCollector will return nothing, except this one conduit B.
Any help would be stellar. I will attach my code if that helps some with context.
Thanks so much.
import System
from System import Array
from System.Collections.Generic import *
view = doc.ActiveView
#get all conduit and electrical fixtures in given view
cat_list = [BuiltInCategory.OST_Conduit,BuiltInCategory.OST_ElectricalFixtures,BuiltInCategory.OST_ElectricalEquipment,BuiltInCategory.OST_ConduitFitting]
typed_list = List[BuiltInCategory](cat_list)
filter = ElementMulticategoryFilter(typed_list)
assemblyel = FilteredElementCollector(doc,view.Id).WherePasses(filter).ToElements()
assemblyids = FilteredElementCollector(doc,view.Id).ToElementIds()
cpointlist = []
try:
for i in assemblyel:
if i.Category.Name == 'Conduits':
cpointlist.append(i.Location.Curve.GetEndPoint(0))
cpointlist.append(i.Location.Curve.GetEndPoint(1))
else:
continue
except:
print('error error error')
def gcinter(points):
ac = []
for p in points:
ol = Outline(p,p)
bbfilter = BoundingBoxIntersectsFilter(ol)
bbfilter.Tolerance = 0.125
collector = FilteredElementCollector(doc).WherePasses(filter)
ids = [doc.ActiveView.Id]
ids.extend(assemblyids)
id = List[ElementId](ids)
intersects = collector.Excluding(id).WherePasses(bbfilter).ToElements()
intersects = [doc.GetElement(x.AssemblyInstanceId).Name for x in intersects]
if len(intersects) != 0: ac.append([p,intersects])
return ac
Solved! Go to Solution.