Filter by Sub Category

Have you looked at Kike’s reponse by any chance? Filter by Sub Category

The error you are mentioning is from the older python component. We have a way to filter geometry by subcategory now which Kike has shown

Thanks, Ehsan.
On first read I did not understand that the categories would also work for subcategories. Very nice add to the component and even more powerful with a value picker to get the subcategory I was after.

1 Like

But I am running into an issue with the geometry in the Revit Family not being assign the correct index in Grasshopper. The highlighted geometry on the left is on the Glass Subcategory in the Revit. But as you can see it is only visible when filtered by all of the subcategories and is visible only when Elevation Swing is picked. Plus there are only 4 subcategories coming from the Element Geometry and Elevation Swing is not one of the. Therefore I am not able to get the geometry that is assigned the Glass Subcategory. If I use a number slider to get the index I can get the highlighted geometry at index 7. This does not match the index from the Category.SubCategories Component which has it at 0.

you have two different trees. Hard see what exactly is going on (param viewer component would help) but it looks like the Element Geometry [4 breps] would have a single category for each branch, then your element category below is branching into sub-categories per each category.

I took a different approach in filtering the subcategory geometry by using the text string of the subcategory to create a cull pattern. I am curious if there is any thoughts on developing a geometry filter component to compliment that Kike added to the Element Geometry component? I am thinking it would be something like the Type Filter and Filter Element combo to create the cull pattern.

Great to see you’ve got it working. Its hard to comment without seeing the file/script of the particular subcategories and geometry you’re filtering.

I have attached the definition. It is attempting to separate out the frame geometry and glass geometry to be utilized for daylighting analysis. Each subcategory is going to a separate layer in Rhino. I would want to filter the subcategory geometry in the same manner that I am filtering the window types.

Revit to Rhino_RhinoInside_Windows.gh (26.3 KB)

Can you post your window as well? These aren’t standard.

The version I am using is not standard but it does utilize the same subcategories as the Out of the Box Revit Families. I have attached window family so we can compare apples to apples.

wn_Fixed Window.rfa (356 KB)

i’m not seeing any sub-cats, maybe i’m not understanding the question.

RE_Revit to Rhino_RhinoInside_Windows.gh (17.6 KB)

On the Element Geometry Component the information coming from the Categories are technically sub-cats in Revit.

I am including another window family that has “Louver” and “Trim Projection” sub-cats.
I would like to be able to filter the sub-cats I would like keep. In this case “Frame/Mullion” and “Glass” Revit Users tend to create a inconsistent sub-cats. So my ideal work flow would be to pick the sub-cats that I want to include and create cull patterns to filter out what I do not want.

I would be suggesting a workflow something like this to deal with sub-cats

Apologies for not being more clear. Long time follower, first time poster :grinning:

Louver - Hollow Metal.rfa (404 KB)

You could branch by the category string if you needed to do particular operations on a tree branches.

Sort Dup Values is a lunchbox component, or the traditional set, set, member index.

Thanks Rickson. I will give those components a go. They are new to me but I am always looking to expand my knowledge.

Hi @cgrammens , did you have any luck exporting the selected Subcategories especially with doors?

Yes. I was able to create the sets as Rickson suggested. But keep in mind how your Revit family sub categories are created. You may need to separate out more sub categories then you’d like based on how people created the families. You can either correct that on the grasshopper side but I would standardize the sub categories on the Revit side. This would make the script easily replicated for any project.

1 Like

Awesome, thanks for letting me know!

I had this problem yesterday with doors in Revit.
I changed one line in the initial Python code to overcome the error from the function “To.brep” for lines.
error_line_fix

I hope this is the right thread. My question is very basic: Is there any way I can extract geometry by material from families in a Revit file WITHOUT actually going into Edit Family for every one of them?

Say the Revit file has a dozen different Curtain Wall families, each comprising geometries with different Material parameters. Using ElementGeometry and its Geometry and Subcategory outputs, is there anyway I can filter out geometries within each family by their material types? This seems to be what the above discussion was about but I’m not totally sure.

In the screenshot below, I’m trying to use the Subcategories to filter out geometries by material but there’s no boolean test available to do so using the Subcategories?

I’m also using the ElementGeometryBySubcategory component but it’s not yielding any ouputs.

Can you save out and post one of the curtain panels families? There are a few ways to structure things and having the actual family will help a bunch. Thanks.

Thanks Japhy. The .rvt file is pretty big and has more than 20+ .rfa within. I will send you a Revit file with just a chunk of CW populated by one family type, as well as the Gh SCRIPT.

1 Like