How do determine which cameras (View3Ds) can be seen by one another?

How do determine which cameras (View3Ds) can be seen by one another?

CollinJoseph0258
Enthusiast Enthusiast
421 Views
4 Replies
Message 1 of 5

How do determine which cameras (View3Ds) can be seen by one another?

CollinJoseph0258
Enthusiast
Enthusiast

I am trying to determine which cameras (View3Ds) in my project are within line of sight of other cameras.

 

I am currently using a line x triangle intersection algorithm on the project geometry meshes to test this, but that can be a very expensive operation depending on the project.

 

Is some API feature that might allow me to do this more efficiently?

 

I have tried using the VisibleInView filter but that does not seem to work.

Accepted solutions (1)
422 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni
Accepted solution

This filtered element collector constructor will search and filter the visible elements in a view:

   

https://www.revitapidocs.com/2022/6359776d-915e-f8a2-4147-b31024671ee1.htm

   

Hence, if you place and tag some visible object or filterable BIM element located where the camera is positioned, you ought to be able to quickly retrieve those specific tagged objects if and only if one view is visible from the other, if you understand what I mean.

  

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

CollinJoseph0258
Enthusiast
Enthusiast

Hey Jeremy, that's a pretty interesting suggestion, thank you!
I'm currently working on something else now, but I will circle back and try this if I have sometime!

0 Likes
Message 4 of 5

CollinJoseph0258
Enthusiast
Enthusiast

Going to mark this as the solution for now. Although I may not have time to try it myself.

0 Likes
Message 5 of 5

jeremy_tammik
Alumni
Alumni

Okey-doke, thank you. I hope it really does work when someone tries it out. The Building Coder also discussed retrieving elements visible in view; maybe that will also be of use:

  

https://thebuildingcoder.typepad.com/blog/2017/05/retrieving-elements-visible-in-view.html

  

 

 

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