Hi
I am working on a house configurator using Dynamo. Unfortunately, I am currently stuck. The code seems correct, but it’s not executing in the right order, which I believe is causing it to not work properly.
I want to customize my house based on groups for the options and global parameters for the length of the walls. all the input is from an excel file.
Below is a WeTransfer link containing the Revit, Dynamo, and Excel files.
Additionally, there’s a video demonstrating the current issue. You can see in the video that the code works separately, but when it runs together, it doesn’t.
Who can assist me with this?
Running the graph multiple times (especially when Freezing nodes) is caching the run data in your graph. If you run it again it will only execute nodes with changed values. You’re not changing anything so it’s not re-running the nodes.
What happens when you close and reopen the file between runs?
1 Like
When I run the entire script after reopening, I receive 0 warnings, but my Revit file ends up unjoining elements because the sequence of actions I execute is incorrect. It executes certain code multiple times and changes lengths before the group is created. I’ve already attempted using wait and delay code, but it’s not effective for me
Because these changes are happening in the model, you need to use a transaction as well to ensure the change actually takes place before automating the next steps.
what do you mean by transaction? I made print script for every order it has to follow in my dynamo if that is what you mean?
A transaction is what commits a change to the Revit database. Dynamo defaults to wrapping everything within a single transaction to Revit. This means Dynamo executes each node in your graph and then pushes the outcome to Revit. If you’re modifying a wall length/location and then trying to place something on that wall, then you want the placement to be based off the new location, which can only happen after that change has been committed to a transaction in Revit.
You can use a Transaction node (Start or End will work) to force Dynamo to push everything before the Transaction to Revit before moving on to the next group of nodes. It’s the same idea as a wait/passthrough node except that the data also needs to be pushed to Revit.
and where can i put this transaction node? behind the last action for example?
okay I put the end node behind something and it is working now but I dont now why
Assuming you placed your Wait node correctly, just after that.
yes I did, okay now i understand I think, An end node excutes it in revit i believe and because of the wait note after it strart the new script right?
Take this example:
You want to place a light fixture in a ceiling and then rotate the fixture to be aligned with the ceiling grid.
Without a transaction, the placement and rotation of the fixture would happen at the same time in your graph. But the fixture can’t be rotated if it doesn’t exist in the model yet. You need a transaction between placing the fixture and rotating it so that the element exists in Revit when the rotation is applied.
Dynamo has to work within a transaction, so placing a Start or End node will always end the current transaction and then start a new one. You effectively need one fewer transaction nodes than actual transactions in Revit.
So i use an ungroup, placegroup and delete group commands. Do i need a End node for this to?
Probably not if each of those interactions is self sufficient.
1 Like
thanks for your help i was really struggeling with the code for like 2 days adding a lot of delays and waiting commands to find out it can all be fixed with 1 end node
1 Like
hey Nick
I again ran in some issues and it probably can be fixed with the right end/start transaction but I can’t find it.
The problem I have now is that when I run my command once it doens’t work and when I run it again it works. This problem repeats itself.
First run:
Second run:
The problem is that the item does not exist because it got deleted probably.
can you help me out?
Dynamo code Intopia 5.dyn (218.6 KB)
Are you still executing the graph without closing after each run? You need to close or otherwise force a refresh of the graph if you’re executing multiple times. Like I said before, Dynamo only updates nodes that have changes in order to save memory and run faster. If you run your graph and then delete those elements from Revit then, yes, they won’t exist anymore but Dynamo will still attempt to use them in the graph (because none of the inputs changed) and error. The error results in a new input/value and allows them to “refresh” on the following run.
You want to run your graph in Dynamo Player to avoid this element binding. For when you’re testing your graph, you can use a little workaround and disconnect the very first node in your graph and run a failed execution between each real run. The errors will reset the nodes so you can plug them back in and run again without having to close and reopen the file.
When I close and re-open my dynamo file and I run my code the warning still pops up. So i don’t know if thats the problem (I can be wrong ofcourse). The screenshots you saw of the two code blocks are the only ones that give on and off warnings. Above those code blocks, I have two exactly the same blocks that do work, so I don’t understand it very well.
You need to provide more information. Always have the node preview bubbles pinned when taking screenshots and make sure the node titles are visible. Also include the full graph and any warnings/errors. Otherwise we’re just guessing at what’s even happening.
okay sorry, below some more information:
image was to large
full image direct link
warning