I’m trying to achieve the following goal and distribute it as a button in the Revit toolbar.
Having a clickable button is essential because I want to make it easily accessible for my team.
Desired Workflow:
Delete a door and replace it with our company’s predefined opening family.
Ensure that the new opening has the same dimensions as the deleted door.
In theory, this should be straightforward, but I’m struggling with the execution of the script.
Current Progress:
I have two scripts:
Manual Mode Script – Works as expected but requires manual execution.
There is clearly some confusion in the script execution.
Challenges Faced:
Handling Element Deletion Properly
I use a Stream Gate to wait for the door to be deleted before placing the new component. Otherwise, the new opening cannot be placed in the same location due to the door “blocking” it.
In the manual script, I use a Data Dam to control execution. Without this, the script enters a loop, causing the newly created void to be deleted on the second run.
This issue is evident when undoing actions in Revit.
I’ve done extensive testing but haven’t found a solution yet.
It would be really helpful if you could take a look.
A simple, clickable button is crucial to making this usable for my team.
I will provide a Revit test file (containing just a wall, a door, and a void) along with two Grasshopper scripts:
Manual Mode Script
Button-Triggered Script (for Revit UI)
Thank You!
I truly appreciate your help and hope there’s a straightforward solution.
If the goal is to keep the opening it seems like you would want to keep it as a door, turn off the visibility per type or remove its geometry and add the Generic Model (or its geometry) to the door Family.
This is about complying with our company’s guidelines.
The family is part of the BIMTool distributed by SOFiSTiK. Their plugin writes additional values to these families using a custom parameter. All annotation families, etc., are specific to this family.
I want to resolve this specific workflow. The script I created is partially working, but there’s an issue with the delete component—it’s not functioning as expected. I’ve tried to describe the problem as clearly as possible.
I understand this might sound uncommon, but imagine a scenario where someone wants to switch Revit’s rectangular wall opening to a door—that’s a similar use case. Maybe that perspective resonates more.
It’s always great to get new perspectives and a different approach to a problem, even if it’s not exactly what I was aiming for. I still believe there might be an issue with the behavior of the delete component in Rhino.Inside, but I’ll test whether changing the family’s category could be a viable solution.
Thanks for your input! I might revisit the delete issue in a new, more focused topic later.
Want to add that typically you should opt for using the easier workflow as Japhy suggested… but since nothing is always typical… please check the below method i used to do something similar before to achieve what you are looking for.
You need to manage the order your elements are being created and deleted, there is no need for timers etc. and since you are using a wall based family you can’t place them with the same dimensions as the door because it will be cutting nothing and you will get an error, so a simple trick is placing it at a slightly higher location then after the door is deleted move it back down by the same value.
NB. you will need to adjust your data trees as needed depending on your use case I jsut set this up quickly to explain the workflow.
I also implemented your idea just before, and it worked as well. You’re really putting a lot of work and effort into this forum, making it incredibly valuable.