DynamoDS/Dynamo — pull request #2641 by Randy-Ma (2014-10-08 10:28:45+00:00)
Title: Fix MAGN-3093 select node (Select Model Element) to show in "error state" when nothing is selected

Reviewers

- [ ] @pboyer
- [ ] @elayabharath

Merge to

- [ ] Revit2015

Summary

This submission will make the select nodes in the warning mode when nothing is selected. This is achieved by setting the state of the nodes to Warning. When setting the selection results, we will check the present results, if there are no elements, the state will be set to Warning.

But every time when the graph is evaluated, all the errors/warnings in the related nodes will be cleared. The errors that ClearError() means to clear are those errors that are created when running the graph. The errors for the selection nodes when nothing is selected is more like a static or interactive error that are not generated when running the graph. As such, ClearError is renamed to ClearRuntimeError. It is overridden in the selection node class so that nothing is done to prevent the errors be cleared when the graph is run.

Some original test cases are modified so that the new behavior can be tested.

Here is the result:

Nothing is selected

![image](https://cloud.githubusercontent.com/assets/5584246/4557347/990a75b2-4ed2-11e4-829a-ca7a7c42edde.png)

Some elements are selected

![image](https://cloud.githubusercontent.com/assets/5584246/4557539/b988f7da-4ed4-11e4-9251-ac681a4cab5d.png)