It is pretty cool seeing the same functionality implemented in two such different ways, on completely different platforms, using different tools.
Alan Seidel shared another exciting Revit add-in.
First and not least, another exciting topic for me personally is switching to half-time work:
Starting April 1, I am working half time.
Unfortunately, April 1 fell on Saturday, we held a team meeting in Gothenburg, and my flight back home with Air Berlin was cancelled, so I ended up working a lot on that specific day, and a weekend, to boot.
I also ended up working more than full time the last two days, finishing off the ForgeFader sample.
Up to me to stop, though.
From now on, my aim is to focus on the Revit question answering system Q4R4, blog, mentor my new colleagues (when they materialise) and spend less time with cases and repetitive questions.
They should be handled automatically by Q4R4 anyway :-)
He shared another full-fledged and advanced Revit add-in in his Revit API discussion forum thread on giving back – a workshared file to be local file opener:
In the spirit of giving back for all the help garnered here to experiment with this idea, and also the challenge to make a Revit file opening video slightly more interesting than watching paint dry, here is something that might be useful to some. Its purpose is to be a one click open a Revit workshared file to be a local file without needing further user input and to do so maintaining the local Revit disk storage area organized better than a heap.
This is a beautiful and advanced sample that provides many important programming pointers.
I love the
RevitFileSniffer to read
BasicFileInfo directly from binary RVT.
I love all the aspects of it!
Modeless WPF, the works!
Here are Allan's video and repository notes:
What is more boring than a Revit file opener? A video of opening a Revit file. That was the challenge here; how to show a one click Revit workshared file opener that opens a workshared central file as a local file without requiring any more user input beyond that first click.
RevitAKSOpen is a Revit add-in in C# that creates a custom ribbon tab with a single control for opening workshared Revit files in one click. The same control is added to the Addins tab. The controls are modeless, active at all times.
Opening a workshared Revit file to be a Local work file is a multistep process. Revit, furthermore, is sloppy about it. It trashes the same local folder with all the local files and their overhead files it saves. Revit also leaves a trap in the Revit desktop when it deposits an icon for the central file one chose. Of course, one can reopen the saved local file instead of the central file, but some are not so daring and often forget to do the critical initial sync. Their Revit managers might insist they never use a local to avoid "issues". Autodesk's publications actually suggest to operate that way. Situations where the Revit coordinator replaces the central file with a copy orphans the local file, so one has to start from the central file again.
Why not present the user with choices from what they have already been working on or point them to choices of the appropriate Revit version to be opened ready to go as a local file stored in an organized, structured pattern while also saving previous work in a similar manner. This add-in does that. It tries, in one click, to automatically pass the various Revit roadblocks and hazards, with added smarts, to properly open a workshared file.
This add-in demonstrates many of the typical tasks and implementation required for providing a tab menu interface and dealing with files. A back-burner improvement is to make the user selection landing areas larger, perhaps changing to or adding preview icons to the interface.
"Tell Me About It" Mode
- A function reporting a Revit file's metadata to determine what Revit version it may be. It reports other useful information. This is one way to determine a Revit file's provenance without actually opening the file in Revit.
Zero document state operation
- Having the add-in available to run when there is not already a Revit file open is called zero document state availability. It makes sense for this add-in to have that availability.
Writing to the Revit status bar
- A thing to know. Revit funnels most of its feedback to the status bar. This add-in uses the status bar to be a whimsical check on who is paying attention.
Useful mundane file and directory operations for reuse
- Making local folders identified with the user's initials.
- Moving prior local files to a local stash folder.
- Indexing the prior local file names so that one can see their generation. This involves the "make a unique name" task one runs into needing in many situations.
- Pruning the number of stashed files.
This repository is provided for sharing and learning purposes. Perhaps someone might provide improvements or education. Perhaps it will help to boost someone further up the steep learning curve needed to create Revit task add-ins. Hopefully it does not show too much of the wrong way.
Much of the code is by others. Its mangling and ignorant misuse is my ongoing doing. Much thanks to the professionals like Jeremy Tammik who provided the means directly or by mention one way or another for probably all the code needed.
Many thanks to Allan for putting together and sharing this!
RvtFader is pretty well documented in its GitHub repository.
I described the initial release talking about RvtFader, AVF, ray tracing and signal attenuation.
I think it provides a cool starting point for any new little application as well, implementing:
- A nice external little external application with custom ribbon tab, panel, split button, main and settings commands
- Manage settings to be edited and stored in a JSON text file.
- Enable user to pick a source point on a floor.
- Determine the floor boundaries.
- Shoot rays from the picked point to an array of other target points covering the floor.
- Determine the obstacles encountered by the ray, specifically wall elements.
- Display a 'heat map', i.e. colour gradient, representing the signal loss caused by the distance and number of walls between the source and the target points.
It uses the Revit API
ReferenceIntersector ray tracing functionality to detect walls and
the analysis visualisation framework AVF to display the heat map.
The result of launching the command and picking a point looks like this:
It is an extension app that calculates and displays signal attenuation caused by distance and obstacles in a building model with a floor plan containing walls.
Here is the result of processing the model displayed above in Revit using ForgeFader:
The four-minute ForgeFader Autodesk Forge sample app YouTube video explains some of the background and shows this sample app live in action:
So far, I discussed two implementation steps here on The Building Coder; and a third important step was contributed by Cyrille Fauvel:
- Adding custom geometry to the Forge viewer
- Three.js raytracing in the Forge Viewer
- Implementing a custom shader in the Forge Viewer
Now the time is more than overdue for me to stop working and get out and do something else!
Already half-way through the third day of the week, and sitting here blogging...