I have a specific generic family that I am trying to filter by level. The issue is the generic family doesn’t have a reference level parameter. Is it possible to filter a family that lives between two levels that doesn’t have the reference level parameter? If it is possible any direction would be appreciated.
Could maybe make a bounding box at that level and grab it through that. I’m sure someones got a smarter way though
Just for some clarification, if the family is between two levels, do you want to use:
-the lower of the two levels
-the higher of the two levels
-the nearest level
What if the object is above the highest level or below the lowest level?
Food for thought below, tweak based on what your task is.
I would want to use the lower of the two levels. The families would never be higher than the highest level. Thinking out load, if a level is selected I’d want to search from the selected level to the next level above it.
If that is the case, the image above is fairly applicable without modification.
Just trying to understand what I’m looking at instead of blindly copying what you created. It is grouping items per level?
There’s four portions to the script.
- Collect Z-values of elements. Collection method is up to you, the randomized list is example data.
- Collect project levels and generate a level list and an elevation list. You may need to modify this to include linked model levels, filter out levels that don’t apply, etc…
- Logic to determine the index value of the elevation below the element. I used a last-item method that compares the z-values to the elevation list. The output of this portion is a list of indices that correspond to the elevation list which also corresponds to the level list.
- GetItemAtIndex generates a list of levels corresponding to the original list of elements. Note list of 20 levels vs list of 20 z-values.
The general input would be a list of family elements, the general output is a list of the same size/order of levels.
If you want them grouped, you can apply a GroupByKey node, using the output level list as the key.