Hello everyone, my first post over here
Im working with dynamo for about one week but I still cannot solve this.
Im creating a user interface with data shapes. I want that once the user have inserted the inputs they are used to create instances. However I also want that once the program is cancelled, nothing happens. As the workflow is, if the user cancel the program I get an obvious error on the node “get item by index”, but I would like that “Get item by index” is only run if the program is not cancelled. What should I put as true on the “if” node in order to stop the program to continue running.
Any help is appreciated,
I don’t know of a way to avoid the error on your second “GetItemAtIndex” because it’s still sending an item as a result from your “IF” node and there isn’t a value at index 1 to pull from. What I use for the “True” input to ensure nothing happens if it’s canceled out is input a blank list or a null value (from wombatDynamo package).
Thanks for your answer Patrick. Unfortunately that’s exactly the problem. As the program is cancelled there is no list for the “GetItemAtIndex” node to work.
I have not been able to figure out a way to only run the “getItemAtIndex” if the program was not cancelled and then take the list from the imputs that the user wrote.
Lets see if any other person know any other trick!
Ah, I see. Forgive me, I misread your post. You can insert a null value (using the wombat Dynamo package) into your “true” input for your IF node. So when a cancel does happen the rest of the workflow will halt because of the null that’s given and when it is not canceled your get item at index nodes will grab the values the user inputted.
I think I figured out a way to stop the error at the “getItemAtIndex” creating a null list with the same amount of items as the user inputs. However, the problem still arises later because I want that if the user interface was run an instance is created and the user inputs are used as values, but if it is cancelled that the workflow completely stops.
I dont know if there is a way to completely stop the workflow (not obtain any value or result) with the “if” node, or if there is any other way of doing it.