Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get cutting void instances in the floor

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
minet.axel
1646 Views, 5 Replies

Get cutting void instances in the floor

Hello,

I have a floor on which a familyinstance is inserted on the face of the floor (the instance to host: the floor). I checked in the family the "Cut with Void When Loaded" parameter so that the void created on the floor. I want to retrieve the instance that creates the void in the floor.

I did some research, and found this link: http: //thebuildingcoder.typepad.com/blog/2011/06/boolean-operations-and-instancevoidcututils.html But when I use InstanceVoidCutUtils.GetCuttingVoidInstances(element) returns an empty list.

5 REPLIES 5
Message 2 of 6
jeremytammik
in reply to: minet.axel

This discussion should provide hints to all you need:

 

http://thebuildingcoder.typepad.com/blog/2015/07/intersect-solid-filter-avf-and-directshape-for-debu...

 

I hope it helps.

 

Please let us know how it goes and how you end up resolving this.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6
minet.axel
in reply to: jeremytammik

 

lsdlfs

 

I want to deduce the voids in the floor. But when I use ElementIntersectsElementFilter or ElementIntersectsSolidFilter, I do not have the expected result (no elements intersect).

 

First case : area = 607.558m2 and Volume = 243.023m3

 

1.PNG

Second case : area = 607.558m2 and Volume = 243.023m3

 

 

 

2.PNG

 Family parameter

 

 3.PNG

 FamilyInstance cutting

4.PNG

 

 

 

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>();

 

Here "n" and "n1" are equal to 0.

 

 

Message 4 of 6
FAIR59
in reply to: minet.axel

try using

 

                List<ElementId> intersectingInstanceIds = floor.FindInserts(false,false,false,true).ToList();
Message 5 of 6
minet.axel
in reply to: FAIR59

I have done some tests and here are my returns.

6 ppt.PNG

 

 

FindInserts returns FI_1 even if its host (Level 3) is not the floor. Its good.I think we can say that the problem is solved.

 

Thank you FAIR59 ;).

Message 6 of 6
jeremytammik
in reply to: minet.axel

Many thanks yet again to Fair59 for his accurate and succinct solution, and to Axel for raising the issue and confirming it!

 

Once again, I think this needs to be preserved and easily found, so I edited and shared on The Building Coder:

 

http://thebuildingcoder.typepad.com/blog/2017/06/findinserts-determines-void-instances-cutting-a-flo...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report