UI Data-Shapes: Delete Multiple categories with check-box

Hi,
I’m using Revit R23 and I want to create an User Interface with Data-Shapes that users can check the boxes that applies to their situation. As I’m new in Dynamo, I have some issues to get my ideas in place.

The script is: Delete the “themes” that doesn’t apply to their new Revit Model that they are creating.

I created 10 different scripts to delete sheets, floor views, ceiling views, legends, schedules, Drafting Views concerning a specific “theme” like, for exemple, if the new project doesn’t includes an Architecture part (we do Interior Design and Architecture). I would like to make only one Script including the 10 scripts and the user could select, with a check-box, the “themes” to delete from the Model.

This is where I am now (I will integrate the missing scripts):

Thank you very much for your help!

Welcome to the forum!

It looks like you have the hard part all worked out (getting the individual “scripts” to work) and now you just need to figure out how to execute them from a selection. You can do this one of two ways, but they’re mostly the same logic:

  1. Have the 10 scripts run first and pass their outputs to the UI selection. If you select inputs 1, 3, and 4 then your graph returns the outputs of scripts 1, 3, and 4. You then pass all those outputs on and delete them.
  2. Have the UI selection run first and pass on a boolean (true or false) for each option. If you select inputs 1, 3, and 4 then your graph returns true for those scripts and false for the others. Then incorporate a boolean check for each script to either run* on its items or not.

*You can’t force Dynamo to not run part of a graph, so you would have to build in logic that either returns an empty list when you don’t want it to “run” or use a Delete node with a boolean option.

Hopefully that gets you started.

1 Like

Thank you very much Nick!
I would like to do your solution #1 but I don’t know how to connect the 10 scripts to the UI :frowning:
I began something but I don’t understand how to join everything together because all my scripts begins with a category that can’t be connect before the script and the Boolean Input from Data-Shapes doesn’t begin with a connection with a script…
I’m confused about how to make this work.

You need a UI node (or 10) to pass to the InputForm. The node you have is the parent form that contains the input or inputs you want to interact with. The input node (probably a radio selection in your case) is where you specify what input you want and how it works. The input typically has a key and a value. The key is the name/selection the user sees and the value is the actual “stuff” that gets passed on with that selection.

It sounds like you want 10 inputs, representing your 10 individual “scripts”. Each input would have a key that tells the user what they’re toggling on or off and a value that is a list of all the items the script generated/found. That way, when you toggle a script on, it’s value (list of items) gets passed on to the Delete node.

Thank you very much, i’m trying that right now :slight_smile:

1 Like

I have the check-box available, the 10 individual scripts are working but when I select some of the “themes”, it deletes every “themes”, not just the selected ones…
I think my Delete command is not at the good place but I don’t know wherelse to put it.

Your Delete needs to come after all the UI stuff. You send the UI the stuff that might be deleted, if it’s selected. The UI will then filter those lists and return only the ones you chose to delete and only then send them on to the Delete node.

2 Likes

Do I put de Delete Node after the “RadioButtons Data” Node or connected to the “MultipleInputForm + + / User Inputs”?
I tried to the “User Inputs”, it deletes the views of my script but not the sheets, schedules (etc…) of only the “themes” I selected. So I sloved the “delete all not just the themes selected” but it doesn’t work as supposed :frowning:

There error is that you have a null which might be solved just by flattening the list before the Delete. Try that and if it doesn’t work show us the outputs of each of the 10 themes before the UI nodes and the output of the UI node after you’ve run everything.

1 Like

Also, ListView would probably be better than radio buttons now that I see what you’re wanting. That will make the UI look a little better and might help the logic too.
image
The graph should look something like this, with all of your selections and their items being fed to the input node and the form returning the selected values.

The List.Flatten didn’t work.

This is one pf the 10 scripts and it works well like that.
You will see that I look for many types of views including Schedules and sheets.
I begin to think that what I want to do is impossible :frowning:

BOMA_02

BOMA_04

If each of you 10 scripts work individually, then I’m pretty confident we can get this to work. Make sure the output of each script is a flattened list before it goes on to the delete node (or before it gets combined into a list like in the image above.) Each script should have a singular output (flattened list) that gets passed through the UI nodes.

You can either combine those outputs into a list of input options and use one input node, or you can create 10 unique input nodes with 10 unique input lists. Try to match the structure I showed in my previous response and see if that works.

Looking at some of your script logic, it could be that you have some list structure issues, but if they work correctly on their own then nothing should change here.

1 Like