ElementIntersectsElementFilter does not run familyInstance

ElementIntersectsElementFilter does not run familyInstance

klkl12234
Advocate Advocate
470 Views
4 Replies
Message 1 of 5

ElementIntersectsElementFilter does not run familyInstance

klkl12234
Advocate
Advocate

Hello, ElementIntersectsElementFilter does not run familyInstance

It was successful in Element.

Below is the code.

Is there any other way?

 

Element ele = doc.GetElement(elementId);

//FamilyInstance insideElement = ele as FamilyInstance;

ElementIntersectsElementFilter elementIntersectsElementFilter = new ElementIntersectsElementFilter(ele);
var filters = new FilteredElementCollector(doc)
.WherePasses(elementIntersectsElementFilter)
.ToList();

 

------------------------------------------------------------------------------------------------------

I added an explanation.

 

The current goal is to review the selected ducts and ducts, the selected ducts and fittings, the selected fittings and ducts, and the interference between the selected fittings and fittings.

 

The current version is the 2019 version.

I would like to conduct an interference review.
For example, in the case of the first photo,

There's a duct called 'a' and a duct called 'b'.

Element ele = doc.GetElement('a');

ElementIntersectsElementFilter elementIntersectsElementFilter = new ElementIntersectsElementFilter(ele);
var filters = new FilteredElementCollector(doc)
.WherePasses(elementIntersectsElementFilter)
.ToList();

The value of the filter is 'b'.

There is no problem so far.

 

 

캡처22222.PNG

This is a problem when a family instance (Duct fitting) called c is added.

캡처333333333.PNG

 

Element ele = doc.GetElement('a');

ElementIntersectsElementFilter elementIntersectsElementFilter = new ElementIntersectsElementFilter(ele);
var filters = new FilteredElementCollector(doc)
.WherePasses(elementIntersectsElementFilter)
.ToList();

The filter has a value of b but not a value of c.

When Duct fitting,I will find other ways.

 

My English was weak, so I used a translator.
Please excuse me..

0 Likes
Accepted solutions (1)
471 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

You provide little information in your nice and succinct question.

 

So, the nice and succinct answer is: No, sorry, I am not aware of any other way.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 5

klkl12234
Advocate
Advocate

Hello, Thank you for your reply.


var filters = new FilteredElementCollector(doc)
.WherePasses(elementIntersectsElementFilter)
.ToList();

 

I thought there were all the elements in the filters.

I made one more and solved it.


var fittingFilters = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_DuctFitting)
.WherePasses(elementIntersectsElementFilter)
.ToList();

 

 

0 Likes
Message 4 of 5

jeremy_tammik
Alumni
Alumni
Accepted solution

Thank you for your more detailed explanation and congratulations on solving your task!

 

The Building Coder shares quite a few articles on this topic:

 

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 5

klkl12234
Advocate
Advocate
Thank you. You helped me a lot
0 Likes