I have been a bit quieter in the Revit API discussion forum in the past day or two.
Why?
Well, I implemented a neat new little sample add-in, RvtFader.
In a rather simplified manner, it calculates and displays signal attenuation caused by distance and obstacles, specifically walls.
That provided an opportunity for me to dive in again into two very interesting pieces of Revit API functionality:
ReferenceIntersector
ray tracing functionality to detect walls and other obstacles between two points.In the course of implementing the AVF part of things, I also resuscitated my trusty old RevitWebcam add-in.
RevitWebcam uses AVF and an external event to display a live webcam image on a selected element face.
The external event polls the webcam for updated images at regular intervals.
I now created a new GitHub repository to host this add-in and migrated it to Revit 2017.
Here it is displaying a webcam image on a wall:
Back to RvtFader
, though:
RvtFader is a Revit C# .NET API add-in to calculate and display signal attenuation using
the analysis visualisation framework AVF
and ReferenceIntersector
ray tracing.
This application works in a Revit model with a floor plan containing walls.
It calculates the signal attenuation caused by distance and obstacles.
In the first iteration, the only obstacles taken into account are walls.
Two signal attenuation values in decibels are defined in the application settings:
Given a source point, calculate the attenuation in a widening circle around it and display that as a heat map.
To achieve this task, RvtFader implements the following:
Summary of the steps towards achieving this:
ErrorProvider
class, Validating
and Validated
events.JavaScriptSerializer
class.ReferenceIntersector
rays traced using ReferenceIntersector
, conditionally compiled based on the pragma definition DEBUG_GRAPHICAL
:AttenuationCalculator
taking walls and door openings into account:For more details on the implementation steps, please refer to the list of releases and commits.
ReferenceIntersector
ray tracing:ReferenceIntersector
was previously named FindReferencesByDirection
FindReferencesByDirection
ReferenceIntersector
in linked files