Cut Family Instance from intersecting Objects, BoundingBoxIntersectsFilter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there,
I have a "maybe" easy problem, but I cannot figure out where my problem consists in. I have a list of objects that i want to cut out of the objects they intersect, using RPW. I thought I create a bounding box of my cutting object and use this as a filter for my FilteredElementCollector.
Anyhow, if I run the code it tries to cut out objects which are far away from the cutting object and meanwhile giving me the error that "connected objects" cannot be separated.
My code looks like that:
for i in idList:
cutobj = doc.GetElement(i)
bb = cutobj.get_BoundingBox(None)
outline = Outline(bb.Min, bb.Max)
intersectFilter = BoundingBoxIntersectsFilter(outline)
intersector_collector = FilteredElementCollector(doc).OfCategory(
BuiltInCategory.OST_GenericModel).WherePasses(intersectFilter)
if intersector_collector != None:
for item in intersector_collector:
SolidSolidCutUtils.AddCutBetweenSolids(doc, item, cutobj)
Any help would be greatly appreciated!