A bit new to the programming of Dynamo with Revit but absolutely loving it. Managed to create a sequence to alert all mirrored objects in a project which was great fun.
Now i am trying to get all references of the rooms in the project to center in the room. Kinda like the CASE-apps used to do… I managed to collect the room data but i have no idea how to continue. Can anyone give me a hint?
Hey guys
When I’m trying to use the script Paul_Wintour refers to “Room Location Centering” in Revit 2016 with Dynamo 1.0, the last part of the script gives me a warning/failure.
Yes it works one time, but then if I has to use it once again, I need to use the indent again - run it, make it fail and then remove the indent again in order to make the script work again.
So the issue isn’t that I don’t know what to do in order to make the script work from time to time, the problem is that the script isn’t reliable/stabil.
You don’t have to “break” it to make it work again. Just put the whole thing inside of an “If” statement and add a boolean toggle input to refresh it. Python node WILL NOT RUN if none of the inputs to it changed. Example:
runIt = IN[2]
if runIt:
#do something
else:
#do nothing
Technically you don’t need to wrap the code in an IF statement. Just having an aditional port IN[2] for a Boolean toggle will do the trick. No need to tie in with code and will work on either true or false values, just need to switch once before you run again. This just triggers the Nodes input changed event and adds to the list of nodes to re-execute.
Same goes for custom nodes, chuck an “input” node within the parent node named refresh which will just add a new port to a the custom node but the input node doesn’t need to be connected to anything downstream in the parent node.
@Konrad_K_Sobon’s solution works nicely for nodes that you don’t want to execute every time and only until you want them to, good for exporting or model updating type nodes. So go with his if that’s the functionality you’re after.