Help with Data-shapes

Hi all,

Looking for some help in adding a UI to a basic dynamo script I wrote that writes room parameter data to excel. I am hoping that the UI can help add additional functionality as well. It has been some time since I’ve used data-shapes (2018) and I am having trouble finding resources to get me to my goals below.

As currently written, the script writes 3 hard-coded parameters to an excel tab for a file at a fixed location. I am hoping to achieve the following with data-shapes UI tools.

-Select room parameters to be written to excel from the list of all room parameters
-Have the ability to order selected parameters to be written in excel ie order of columns in excel
-Select excel file via to write to via browser
-Select excel tab to overwrite via selection (can’t remember if this is possible) or specify via form

Ideally the majority of the information could be specified from the initial UI pop-up.

Any help would be greatly appreciated. I was hoping there would have been more in terms of tutorials on YouTube so any resources would also be welcomed.

Thank you for your time,
g

Welcome!

Which Data-Shapes nodes have you tried so far? It sounds like you need a node to select multiple items in a list, a node to select a file in browser, and a node to select an item from a dropdown. Those all exist as base functionality within Data-Shapes.

Ordering your selection will likely require a little extra work but is fairly straightforward. After the first selection of parameters to query, create a dropdown for each one to represent the columns in Excel. The parameter selected in each dropdown would then be the parameter to assign to each column.

Hi Nick,

Thanks for the welcome. I had tried a DropDown Data but I seem to be querying all parameters of all rooms. I know I crossed some wire here and the Listview Data might be more appropriate.

Yup. You’re getting all rooms, then all parameters from all rooms, then creating a dropdown with all those values. That’s not going to work. You just need all the parameters associated with rooms. You can do this by just using the parameters from one room.

Correct. List.View will allow you to select multiple parameters from all those provided. Then you will use the selected parameters to create dropdowns to choose order, but that’s step two.

Thanks for the direction! I’ve solved the first part and am now able to get a list of selected parameters from a given element.

Now I’m a little unsure about what the next steps should be order of operations wise, but here’s my guess.
-Figure out how to get element parameter values for all elements of initially selected type (in this case rooms)
-Split data (initially selected parameters) for all elements into individual lists
-Specify column per list for excel writing

Also, is my initial goal of having the user specify all information from a single data shapes prompt possible? Given the steps outlined above must the user first select parameters, run script, then be met with another prompt to specify excel columns?

Any help regarding next steps and ui navigation would be greatly appreciated.

Thanks

Your graph is illegible so I can’t tell exactly what you’re doing but it sounds like you have the right idea. You can do all of this in one script, but it will take two input prompts: the first to select the parameters to include and the second to order them. You’ll likely want to do all of this through a single list structure, otherwise it wouldn’t be dynamic (you’d have to know how many parameters are being selected to know how many lists to deal with) - this is best practice anyway.

  1. Use Data-Shapes to select the required parameters from a list. This gives us a variable, but known, number of parameters to deal with, n.
  2. Create a dropdown input with Data-Shapes for each parameter selected. We can do this by duplicating the dropdown input n number of times and labeling them 1-n.
  3. Prompt for the second input (parameter/column order) with each list of dropdown options being the list of selected parameters. The label represents the column placement and the parameter determines which parameter will go in that column: Dropdown 1 will be the first column, Dropdown 2 will be the second column, etc.
  4. Use the list of ordered dropdown values to get the matching parameter values from your list of elements using the appropriate list levels.
  5. Transpose the data (to match Excel formatting) and export.

Thank you for taking a look. Apologies for the illegible graph, not sure what the issue is there. I am able to download and view clearly. Will try the steps you mentioned, thanks again

The node titles aren’t visible. This happens when you’re zoomed out too far. Always use the Export as Image button in Dynamo when taking screenshots and always make sure the node titles are visible. The export will include the full graph, not just what’s visible on screen so you don’t need to worry about cropping.

Understood, my apologies. See larger export below.

Thanks for the direction and sorry for the delay. I’ve tried to incorporate your feedback but despite being met with what appear to be correct UI prompts, the DropDown user input doesn’t seem to reflect my selection once the script is run. Any advice?

Please see screenshot and full script below.


None of your inputs match in structure which is going to make things really confusing. You either need to use flattened lists with the correct list levels or the exact number/structure of inputs. Remember, a single dropdown will have multiple options to choose from which means multiple key, value pairs.

Your key, value pairs are also unrelated, so the outputs do actually match what you have defined - they’re just wrong. The key selected will return the corresponding value.

Right now you have a dropdown for each parameter and you’re selecting the column. You can do it this way but it requires extra work in rearranging the parameters and the columns to then be in the correct order. My suggestion was to have a dropdown for each column and select the parameter. That way you don’t have to rearrange anything. The output will be the list of parameters in order, so you can just get the values directly from the parameter list and they’ll already be in the correct order.