Hi everyone. Another post about UI creation for dynamo with the Data-Shapes package. The focus is this time on the ListView input because itl has gained a lot more flexibility in the latest update (2017.05.05). This post is to document those changes and enhancements.
New functionnalities are optional:
Important note: If you update the package, you’ll have to make a little manipulation on pre existing scrpits using the UI.ListView Data node : You’ll have to right clic the new optional inputs and check “Use default value”:
Once you activate the default values for the four new optional inputs, the script will function normally. You won’t need to do this when using new instances of UI.ListView Data nodes.
Now that this has been said, I will introduce the new functionalities:
Highlight In View functionality
If you set the “HighlightInView” input of the node to true, the listview will function in a similar way to a Dynamo watch node. Not only will it display the elements, but clicking an item on the list that represents a revit element will highlight the element in an appropriate view in Revit. Clicking the same listview item multiple times will browse Revit views containing the element and center these views on the element:
Here it is in action:
Display Mode functionality
This functionality was added by Andreas Dieckmann (@a_dieckmann) – the Data-Shapes package is open source, you can now find all the code on my github repository, fork it and submit pull requests. This was made possible with Adreas’ help, so a big thanks to him!
The Display Mode functionality is activated by setting te “DisplayModeOnly” input to true. It will turn the ListView into a display panel without checkboxes. When the ListView is on display mode, it won’t return anything to the list of outputs of UI.MulitpleInputForm++ (just like UI.TextNote and UI.Image), making it a great tool to display lists of data to the user of the script:
You can of course combine DiplayMode and Highlight in view functionalities to give the user a perfect way to browse elements of interest for your script:
Show Element Count
This functionality was added by Andreas Dieckmann (@a_dieckmann) . It allows to display the number of elements in the list right under it’s label:
Default Value Indices
This functionality was added by Andreas Dieckmann (@a_dieckmann) . It allows to set some default values to a ListView by specifying their indices. Those elements will have their checkboxe checked by default:
I hope all of this helps you build better tools! Feel free to leave your comments and suggestions here or on the github repo!