Can I use a Curve with FilteredElementConnector() and WherePasses()?

Can I use a Curve with FilteredElementConnector() and WherePasses()?

willjbird
Contributor Contributor
550 Views
3 Replies
Message 1 of 4

Can I use a Curve with FilteredElementConnector() and WherePasses()?

willjbird
Contributor
Contributor

Hi there,

 

As the title says, can I use a curve/line as the ElementFilter for WherePasses() in an FilteredElementCollector()? It seems like I can't. I've created an Outline from the start point and end point of the curve, then created a BoundingBoxIntersectsFilter from the Outline but no elements are returned. All elements are returned when WherePasses() is not used as per the expected behaviour so no issues there.

 

Context:

I am projecting a curve from a point of a certain length, and I want to retrieve elements (well, the first element) that the curve passes through. Is this possible using FilteredElementCollector or should I be using another technique?

 

I've attached a screenshot of a visualization using Dynamo to show what I'm trying to do...

 

Thanks!

 

 

 

 

0 Likes
Accepted solutions (1)
551 Views
3 Replies
Replies (3)
Message 3 of 4

willjbird
Contributor
Contributor

Thanks for the response.

 

Turns out my whole issue I was not sending the correct Document to FilteredElementCollector but fixing that has fixed my issue.

 

However, reading your link has provided me with very valuable information I hadn't considered so thanks for that!

 

Cheers

0 Likes
Message 4 of 4

willjbird
Contributor
Contributor
Accepted solution

Hi all

 

Just for any future reference, a better way to do this I've found is using ReferenceIntersector().

 

Cheers

0 Likes