Hallo dynamo users,
i am curently working on a project that wil write to a log file how the script was run. it includes the date it was used, who used it and which version of dynamo and revit.
also i made it give the option to give feedback, therefore the user has to fill in a form that says: did the script work?
for that i used some datashapes.
the script is almost finished only their is one thing i cant get working
the question that ask if the script worked i build using datashapes comes when you hit the start button and not after the script has run, so now the user have to say before the script has runned if it worked.
i already tried a lot of options: transaction end/start wait for, pass, etc. but none of it did work.
does somebody know how to fix this?
i have included the node and some pictures
I can’t understand from your script how you’re using DataShapes UI form…
but what i do usually when i seek subsequent UI forms in DataShapes is the following :
- i have my complete script ( whatever its purpose ) connected to DataShapes Input form.
- if i want to follow that with a msg for the user ( or a second part of a script ) or in your case you need the user to input more info then just connect the
was run from your first input form to the
toggle in your second input form.
By doing so you’ll be running the second part only if the first was run already, hence achieving the sequence you want.
thanks for helping me
I tried using the was run from the first form or from other results, i also did put them in to the toggle, but none of it helped, it already know’s if it’s gone be true or false somehow.
for example i also tried running an list is empty after the first part of the script and used that true as a toggle but still didn’t work out
WriteLogv2.dyf (20.3 KB)
what version of data shapes are you using ?
Maybe @Mostafa_El_Ayoubi can help
i am using version 2017.5.10 i hope somebody can help me out!
You should be able to use a Wait node. Or you could somehow tie your final “script” node to the DataShapes form so that it can’t run until the script has a final output.
yes, that should be possible, only the wait node does not work. as soon als i have the toggle connected to another node that i know wil eventually give a true output. it will always start running with the datashapes instead of the first part of the script.
Have you closed out of your dyn file and reopened? Sometimes if I run DataShapes too many times within a single session it gets a little confused.
You could try my second option as well. Something like counting the final number of elements affected by your script and returning “n elements have been modified. Was the script successful?” so that you can pass that into your DataShapes node.
a combination of Transaction end / start and @Andreas_Dieckmann 's PassThrough should work.
Here’s a dummy example that colors all walls red then prompts the user to give feedback:
Thanks for confirming it is possible! After seeing this principle working in action I checked what we might have done differently (we tried something like this) and in Revit 2017 it works, while it works the other way around in 2015/2016. Might be that in the API the transaction process has been improved. Good to know! Do you perhaps have an earlier version of Datashapes that does work in 2016?
@arjanouwehand sorry, I just couldn’t wait till monday!
You will find it in online package search.
I have a script to copy 3D views and apply them a temporary view template, that i was previously create because it overrides the revit links. And at the script end, i want to remove that view template from the project.
The script works perfectly if i don´t remove the template, but if i delete it, the views automatically apply the VG of the begining view template but without any view template applied.
I don´t know exactly how to apply those nodes that you talked about.