Get cutting void instances in the floor

Get cutting void instances in the floor

minet.axel
Enthusiast Enthusiast
2,045 Views
5 Replies
Message 1 of 6

Get cutting void instances in the floor

minet.axel
Enthusiast
Enthusiast

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.

0 Likes
Accepted solutions (1)
2,046 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

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

0 Likes
Message 3 of 6

minet.axel
Enthusiast
Enthusiast

 

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.

 

 

0 Likes
Message 4 of 6

FAIR59
Advisor
Advisor
Accepted solution

try using

 

                List<ElementId> intersectingInstanceIds = floor.FindInserts(false,false,false,true).ToList();
Message 5 of 6

minet.axel
Enthusiast
Enthusiast

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
Autodesk
Autodesk

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