ReferenceIntersector produce inconsistent result when execute many times in a particular 3D view

ReferenceIntersector produce inconsistent result when execute many times in a particular 3D view

longt61
Advocate Advocate
510 Views
2 Replies
Message 1 of 3

ReferenceIntersector produce inconsistent result when execute many times in a particular 3D view

longt61
Advocate
Advocate

I am using Revit API 2019 and using ReferenceIntersector to find the ceiling of a given room in my project. However, both Find() and FindNearest() method return inconsistent result when I execute the command a few times with a given 3D view. I got around 50/50 chances of finding ceiling of a particular room as follow:

1rst time: succeed

2nd time: fail

3rd time: succeed

4th time: fail

5th time: fail

6th time: succeed

...

As mentioned in documentation for this class, all required elements are visible and inside the crop box of given 3D view. However, if I switch to the default 3D view, I got 100% chance of success (so far at least). And both 3D view seem to be mostly identical to each other (detail level, crop box, visibility/ override graphic... are the same).

What do I miss here? Is there any settings that can affect the result of ReferenceIntersector ?

Thank you all in advance.

0 Likes
Accepted solutions (1)
511 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni
Accepted solution

You may be shooting a ray that exactly hits an edge of the ceiling.

  

Due to floating point inaccuracies, trying to exactly intersect an edge of infinitesimal width by shooting an infinitesimally thin ray is an unpredictable question of hit and miss.

 

Try shooting your ray in the middle of the ceiling, or at least at a non-infinitesimal distance from all its edges.

  

In Revit, a non-infinitesimal distance is at least 1 millimetre or 1/16 of an inch.

  

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

jeremy_tammik
Alumni
Alumni

Deleted.

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