Filter by Sub Category

Haha no worries bud. They are documented here btw:

Hi! How come I cant make this work for this curtain wall?
What are the limitations for making this work with a curtain wall?

Love this plugin so far btw.

Oh, so now I think I got it. What I fetch here is only the hosts/voids- whereas if I want to get the curtain walls themselves I need to select them as a category. Makes sense.

It would still be nice to get this void volume. I would be able to more quickly create a very simplified version of the curtain wall system for daylight analysis. Working with non orthagonal bounding boxes of the curtain walls is a task…

1 Like

Hi Ehsan,

Thanks for posting this, exactly what I need.

However I am getting an error when I open your example in Revit/GH.

"1. Solution exception:‘RhinoInside.Revit.Convert’ object has no attribute ‘ToRhino’’

And idea why?

Thanks in advance,

Jak

@jak
The recent changes has broken some of those scripted components. I’ll fix the example and will update this thread

@jak modify the script inside the error’d component to this:

import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI') 
clr.AddReference('RevitAPIUI')

from System import Enum

import rhinoscriptsyntax as rs
import Rhino
import RhinoInside
import Grasshopper as GH
from RhinoInside.Revit import Revit
from Autodesk.Revit import DB

# loading extension methods are necessary to access convertor methods
# e.g. Solid.ToBrep()
clr.ImportExtensions(RhinoInside.Revit.Convert.Geometry)

doc = Revit.ActiveDBDocument

def get_geom_element_props(geom_element):
    gobjs = [x for x in geom_element if x.GraphicsStyleId != DB.ElementId.InvalidElementId]
    breps = [x.ToBrep() for x in gobjs]
    cats = [doc.GetElement(x.GraphicsStyleId).GraphicsStyleCategory for x in gobjs]
    return gobjs, breps, cats


# get element geometry
if isinstance(E, DB.Element):
    opts = DB.Options()
    opts.ComputeReferences = True
    geom_element = E.Geometry[opts]
    for geom_inst in geom_element:
        inst_geom = geom_inst.GetInstanceGeometry()
        G, B, C = get_geom_element_props(inst_geom)

Changes

The new Rhino.Inside.Revit API has change the namespace for conversion methods. So loading the C# extension methods is necessary now. See these new lines added to the script:

# loading extension methods are necessary to access convertor methods
# e.g. Solid.ToBrep()
clr.ImportExtensions(RhinoInside.Revit.Convert.Geometry)

No you can call the ToBrep() method on the Revit Solid object:

    breps = [x.ToBrep() for x in gobjs]
1 Like

Hi Ehsan,

Thankyou for your assistance, I just got around to trying your update. It seems to be working now with simple families, Windows / Doors etc, however I run into issues with Curtain Panels. I don’t see an error, just nothing shows up through the component…

I am trying to isolate any geometry on the ‘Glass’ sub layer from a few panel families for shading analysis. The work around so far has been to use the LOD as a filter, however it would be great to have this working properly through sublayer categories.

Thanks in advance,

Jak

1 Like

Hi Ehsan,

It looks like with the modified script I get the following error: 1. Solution exception:‘Line’ object has no attribute ‘ToBrep’

Thank you,

Would you mind sharing the erroring GH definition so I can test?

Actually, just re-downloaded / updated everything and the modified script now works great.

Thanks again!

1 Like

Hi Brandino,

I’m actually having the same issue. What did you update/re-download to work? I updated WIP + rhino.inside today but no fix.

  1. Solution exception:‘Line’ object has no attribute ‘ToBrep’

whats getting picked up from the revit file v
image

“glass” is what’s picked in the subcategories. Thanks!

Ryssa

Hi,

We have included this component functionality in last version.
Now ‘Element Geometry’ has a new output parameter called ‘Categories’ that is what you are looking for.

To enable it just zoom on the component and add it.

The other input parameter allows you to extract element geometry excluding other elements.

For example to extract wall geometry ignoring all or some modifiers-inserts (openings, windows, doors). This will give you the original geometry of the walls.

1 Like

Is there an updated way to select subcategories?
My model contains curtain walls made in rhino and sent to revit,
and interior walls made in revit that I want to bring into Rhino…
How would I only access the sub category interior wall to bring that into Rhino with Rhino.inside?
Thanks in advance!

@ethank
There is no subcategory under walls for “Interior” vs “Exterior”. That is set as the “Wall Function” property inside the Wall Type. So you need to collect the walls based on their type.

Take a look at this: https://www.rhino3d.com/inside/revit/beta/guides/revit-walls#by-wall-type

I am having the same issue above with the following error: 1. Solution exception:‘Line’ object has no attribute ‘ToBrep’. I have updated to the latest version of Rhino.Inside and redownloaded the custom component. I am attempting to get the subcategory geometry from a door family.

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.