Dynamo
Dynamo copied to clipboard
BUG : Dynamo returning nulls for all inputs if a OOTB ScopeIf component is used.
If this issue is with Dynamo for Revit, please post your issue on the Dynamo for Revit Issues page.
If this issue is not a bug report or improvement request, please check the Dynamo forum, and start a thread there to discuss your issue.
Dynamo Core: 2.1.0.7500 Dynamo Revit: 2.1.0.7733
(Which version of Dynamo are you using? Go to Help > About if you're not sure.)
Operating system
Windows 10
What did you do?
Opened a graph I have been working on before
What did you expect to see?
Working code as it was when i last closed it.
What did you see instead?
Found that all the input nodes returned null even after after running the graph this includes nodes such as plane xy and number slider.
What i found the error to be? (That needs to be fixed)
As soon as i replaced all the ScopeIf nodes i had put into to replace If nodes. (As the ScopeIf does not return a list if one of the the inputs was not a list, in this case false is null to stop the next part of the code running, so this was a useful change from the If node) With If nodes again the graph worked again as expected.
Considering this is an out of the box node this is another worrying BUG, as i had no idea what i had changed to make my whole code fail. As my code is linked to the running of a larger project i was unable to show any of my work from last week at this mornings progress meeting as the code was not able to work at all and in turn write out any geometry to the Revit family/s.
Hello Matt,
So sorry that the nodes failed on you - especially during a presentation. The If and ScopeIf nodes are on our already radar for some quality-of-life improvements.
@MattGaydon can you attach a simple graph that reproduces this issue? Or your original graph?
@mjkkirschner
I pulled the broken graph apart till i had the minimum number of nodes and it was still breaking and only one ScopeIf. The main project graph uses them as switches to decide if to run another section of code or to report a error note, such as "unbuildable"
One thing i did notice when i tested it was that:
-
If the boolean for the ScopeIf node is calculated within the graph, in the case Geometry.DoesIntersect then the ScopeIf returns all the inputs, nodes as null with only some having warnings.
-
If the boolean comes from a boolean node switch input the ScopeIf returns in this case the circle and the inputs run.
-
Also note if you put a boolean node (True/False switch) on screen but don't connect it its crashing Dynamo's virtual machine so deleted this node again from the graph posted.
Dynamo code in Zip folder.
Broken _ScopeIf.zip

Your investigation is on the right track - scopeif is not like other nodes - it actually does not execute any of the nodes connected to one of its branches - this means that if that branch is somehow tied to the test itself input itself very weird things can happen - I’m sorry you hit this because the docs for scope if are poor - but try completely separating the 3 branches of inputs so there are no connections between them.
On Nov 14, 2019, at 3:51 AM, MattGaydon [email protected] wrote:
@mjkkirschner
I pulled the broken graph apart till i had the minimum number of nodes and it was still breaking and only one ScopeIf. The main project graph uses them as switches to decide if to run another section of code or to report a error note, such as "unbuildable"
One thing i did notice when i tested it was that:
If the boolean for the ScopeIf node is calculated within the graph, in the case Geometry.DoesIntersect then the ScopeIf returns all the inputs, nodes as null with only some having warnings.
If the boolean comes from a boolean node switch input the ScopeIf returns in this case the circle and the inputs run.
Also note if you put a boolean node (True/False switch) on screen but don't connect it its crashing Dynamo's virtual machine so deleted this node again from the graph posted.
Dynamo code in Zip folder. Broken _ScopeIf.zip
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.