Phase Filter by Elements

Guys, good morning!
I’m here to ask for your help again, I’m trying to create a filter to identify only the categories that I am selecting. For example, I created a list where I can filter three categories and I also wanted to identify what is new or demolished within these categories through the Phase Filter.

Would that be possible? How could I make this filter?

Hi @leandro.dias,

There is a All Elements at Phase node in the Genius Loci package.
You could then filter the collected items by category.

Alan, sorry for the ignorance, I’m still new, I’m not used to programming in general and not even in Dynamo. I’m trying to insert it here, but I can’t make it work in any way.

You could also get the Phase value from each element, get the Name from the Phase, and then GroupByKey to group each element by Phase.

The code of the custom nodes was written using the Python 2.7 engine. So the DynamoIronPython2.7 package version 2.5 must also be installed for the custom node to run.

@Nick_Boyts’s method with GroupBykey will be just as effective.

Guys, I apologize because I always use Dynamo to try to solve small things and I can’t develop much on my own, but I couldn’t make it work in any way.

I apologize for not being able to do so, but could you show me an example?

Can you show us what you have so far?

So, I made this routine to filter connections and pipes, and it counts the connections filtering by type, length, diameter, etc. After counting, it separates and assigns an equal value to the same connections. However, I’m working on a project with phases, and I would have to create a numbering for what will be demolished and another numbering for what will be new.

I just can’t make it work, to put it on everything worked out, but this filter of only numbering what is in the “demolished” phase I can’t manage. I’ve reached my limit!!

1

2

Phase Created is just a parameter, so you would get that parameter value from each element as well. That should return an phase element which you can get the name from and then you can group the elements by phase name or the combined values, whatever you’re after.

I don’t know how or where to insert this filter in this code, I’m stuck, I don’t know where to go.

You already get the other parameters. You need to do the same thing with Phase Created. I don’t know the logic of how you want the elements filtered, but I assume it would either be the same as you’re doing now (just add in the phase name) or the phases would be filtered separately (use the same logic before/after the combined values).

I would also recommend you work through the Dynamo Primer and get some practice with the basics as that will make this much easier.