Is it hot enough for you?
It sure is for this guy:
Time for some rest and recuperation, meseems...
Before that, let me share another brilliant and super succinct solution provided by Fair59, answering
the Revit API discussion forum thread on how
to get cutting void instances in the floor using
Question: I have a floor on which a family instance is inserted on the face of the floor (the instance host is also the floor).
I checked in the family the "Cut with Void When Loaded" parameter, so that the void is created in the floor.
Now, I want to retrieve all the instances that create voids in the floor.
I did some research, and found the discussion
of Boolean operations and
But when I use the
GetCuttingVoidInstances method, it returns an empty list.
I also looked
ElementIntersectsSolidFilter problem and solution and
Those filters do not return the expected result for me to deduce the voids in the floor either; in fact, they say that no elements intersect.
First case – area = 607.558m2 and Volume = 243.023m3:
Second case – area = 607.558m2 and Volume = 243.023m3:
Family parameter "Cut with Voids When Loaded":
FamilyInstance cutting host:
Here is the code I use:
Solid solid = floor.get_Geometry( new Options() ) .OfType<Solid>() .Where<Solid>( s => (null != s) && (!s.Edges.IsEmpty) ) .FirstOrDefault(); FilteredElementCollector intersectingInstances = new FilteredElementCollector( doc ) .OfClass( typeof( FamilyInstance ) ) .WherePasses( new ElementIntersectsSolidFilter( solid ) ); int n1 = intersectingInstances.Count<Element>(); intersectingInstances = new FilteredElementCollector( doc ) .OfClass( typeof( FamilyInstance ) ) .WherePasses( new ElementIntersectsElementFilter( floor ) ); int n = intersectingInstances.Count<Element>();
n1 are equal to 0.
Answer: Try using
FindInserts method instead:
HostObject floor; List<ElementId> intersectingInstanceIds = floor.FindInserts( false, false, false, true ) .ToList();
Response: I have done some tests and here are my results:
Fl_1is hosted by Level 3 and intersects the floor.
Fl_2is hosted by the floor and intersects it.
- Do not cut geometry:
- Cut geometry:
FI_1 even if its host (Level 3) is not the floor.
I think we can say that the problem is solved.
Thank you FAIR59 ;)