Data-Shapes, problem with script

I made a simple script to hide and unhide elements when working in Revit. I am attempting to add Data-Shapes UI to it. This is my first time using Data-Shapes. I have tried everything that I can think of to solve this problem. I am having the problem in the output area. the “Views.GetByType” and “Views.SetCategoryOverrides” are giving me errors. I can use the org code just fine. I would love to be able to adjust all of the views with on click. I will be adding to the dropdown data node once I can get “Scope Box” to work. Any help would be awesome.




datashapeUI

Can you repost with the node previews showing? We can’t really tell what’s going on if we can’t see what the nodes are doing. You also need to be supplying the Scope Box category (not just a string) in order to hide it. But if you’re only including Scope Box as the category then you don’t need it as an input… unless you’re wanting to choose from a list of Scope Boxes to hide?

the first picture is the original script. the second picture is the new script using the UI. The last 3 pictures are the script in their color coded order. what do you need me to screen shot give you a better idea of what is going on?

The node previews showing the outputs of each node. That way we can see what’s happening at each step along the way instead of guessing at what might be happening.

Is this what you are needing?


If you hover over a node it will show an expandable preview of the output below the node. Click the pin to keep the preview visible. Do this for all your nodes so we can see what their inputs and outputs are.
image

Ok. Terminology problem there for me. This should be what you are asking for.



Ok, so you’re not actually using the same inputs between the original script and the new one. The original script uses ViewType and a Category as the inputs, but your new script uses a list of Views and a String. If you’re selecting the Views through the UI then you don’t need to filter by ViewType later on. And as I mentioned earlier, if you’re toggling the visibility of Scope Boxes then you need to use the Scope Box category instead of just a string. If your intent is to control individual Scope Boxes then you need to do the same thing you did with Views and provide a list of Scope Boxes to choose from. Otherwise the Scope Box selection is unneccessary.

My final intent is to be able to turn on and off all scope boxes and all elevation markers in all views before printing the project. current when using dynamo player I can only select one element and one view at a time. I am trying to figure out the family type for scope boxes and elevation markers do make the bottom of the script look like the top.

This makes it sound like you don’t need a selection then. What inputs do you need from Data-Shapes? If you’re toggling all scope boxes and/or elevations then you should be modifying the VG Overrides/View Template of the view rather than hiding all of them.

This is the way I have it set up in dynamo player. I have to use the drop down menu for everything. I would like to have data-shape give me a check list for all views , and a dropdown for what to hide, (although a checklist would not bother me if that is my only choice). I would also like to be able to toggle “What to Hide” on and off like the Boolean switch I have here. I have to make it idiot proof for other people in the office who will not know when to hit the “edit input buttons” or just the “run script button”. That is why I am trying to learn data shapes to make it one click for all. No one else here in the office uses dynamo but some are starting to watch me and want to use it. Thank you for your help

Great. I’m still not sure if you’re wanting to select individual views or all views of a selected ViewType, but the setup is essentially the same. You need to provide a list of either the Views or the ViewTypes as well as a list of all the categories you would want to toggle. Keep in mind that these need to be the elements, not just the names. I would also suggest rewording your true/false selection. I understand that toggle is to hide, so true = off, but it would make more sense to just call the input “Hide” or “Hidden” so that your users aren’t dealing with a double negative.

I want the ability to select all views or select certain views depending on what I am doing. I want a list of categories I can toggle. I havent been able to get a categories drop down list to show up in data-shape that has all the thing I toggle on and off…ie scope boxes, elevation markers, room tags ect…

You would have to build the list of categories yourself or find a custom node that gets all model/annotation categories depending on what you want.

:grinning: That is the next step. I am still trying to solve the first problem

What’s the “first problem”? You were providing the wrong inputs. The solution is to provide the correct inputs, which would be the list of categories you want to toggle. It would be easier to help you and understand where you’re at if you provided screenshots of updates.