Tuesday, May 9, 2017

Dynamo Package Data|Shapes Listview Input Enhancements

From the DATA|SHAPES website:


By Mostafa El Ayoubi
8 May 2017

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.


The new functionalities of the ListView input are all optional. You can still use it in the same way you did with previous versions of the package:

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:


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:

When HighlightInView is set to true, the ListView has a different appearance, making noticable to the user.

Here it is in action:


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:


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:


This functionality was added by Andreas Dieckmann (@a_dieckmann) . It allows to set some default values to a ListView by specifying their indices. Thos 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!

There's more information available on the DATA|SHAPES website.

No comments: