I’m trying to automate the formatting of sales plans for a residential building.
I have several sheets (one per apartment), each containing a location plan for the corresponding apartment.
A red-colored shape indicates the apartment in question.
In Revit and Dynamo, I chose to use Zones (HVAC Zones) with a color filter.
My goal is to automate the creation of these plans, showing only the zone corresponding to the apartment number, while hiding all others.
Each Zone has a parameter “ZONE_NUM_APPART” which corresponds to the apartment number.
So far, I’ve used a node “All Elements of Category in View” to select all the zones on each plan to be created.
Downstream, a “GetParameterValueByName” node (LIST B, shown coming out of the “List.Sort” node) gives me all the zones present on each plan.
I also have a list of apartment numbers as strings (LIST A, shown on the Watch node).
Note: In each index of List B, we find the values from List A.
What I want to do is filter List B using a Boolean mask based on List A, in order to feed the filtered list into View.HideElementsTemporary to hide the unwanted Zones.
Could you help me with the last part (replacing the “WHAT SHOULD I DO ???” Python node)?
Maybe my approach is not the right one — I’m open to suggestions!
Hi. It’s hard to catch the logic of what you need. If I understood you correct, let’s say you have apartements 1,2,3,4,5. For each apartment you have a zone and a view. And you want to get rid of the rest of zones on view? Let’s say on view for apartment 1 you want to hide 2,3,4,5 zones, and keep visible only zone 1, is that correct?
If it is what you want, then try this:
Make sure that the list of views you’re feeding is aligned with the apartment numbers from list A
Chop the list A by length 1
Find a node Lits.Index of, and connect list B (List) and chopped list A(element), with @L2 on both inputs
By using the output indexes, you can use node List.RemoveItemAtIndex and connect as list input your Zones (not strings!). Don’t forget to use @L2 in both inputs.
As result, you hopefully will get the list of zones you want to hide per each view.
Agreed, it’s a little confusing. Would probably be better to show a screenshot of your graph in action but the expected output is helpful. It sounds like you have a list of all zones and a list of views (for each zone) that needs to be filtered down to just the zone in question. I think List.Contains is all you need in that case. Check each sublist in List B to see if it contains the item at the same index in List A
I try somethng with List.Contains, but I need to send to View.HideElementTemporary, all the unwanted zone.
(For View 11, all zone exept zone11 / For View 12, all zone exept zone12, etc..)
Does List.contain had an True/False output, so I can separate what I want to keep ?
It does. You can select a node and read the description/details to see what the required inputs or expected outputs are. That way you know what to expect before trying to work out the logic with the wrong node.