Filter by Sub Category

I’m trying to extract just the glass from window elements, and having a tough time. Is there a way to filter by the sub-category that I’m missing?

Are you pulling the geometry from the window instances? Give me a little context or screenshots so I know which direction you are taking.

sure -
my goal is to export geometry for daylighting analysis in rhino - obviously we can export the traditional method from revit but the gh link offers some potential advantages - having access to subcategory data or material data by geometry being a major one. Of all categories, windows are the trickiest because normally you have to manually change the layer names in export dialog to separate the window glass geometry from all the framing and mullions that’s included in the families (or manually clean it up in rh/gh). And different architecture firms build their curtain wall and punched window families differently complicating matters.

2 methods have yet to work shown in the screenshot below:

  1. Sub-categories as a list, but i can’t access that as a data branch in the Element, and i can’t seem to add it as a filter.
  2. Material types in the family, but can’t seem to find a way to filter geometry by material type

I think instead of separate components for geometry and material off the elements component, a single component would output geometry, material, and parameter data with the data trees correctly linked so one could extract geometry by assigned material. Unless this function already exists in some way that I just haven’t figured yet…
thanks for the help

Hey @dalight

Please see the attached Grasshopper definition for an example of how to get geometry (Revit API and Rhino Breps) from a family instance based on the selected subcategory.

This should help grabbing the geometry you need from all sort of family instances

instace geometry by subcategory.zip (1.2 MB)

I never thanked you for this ! great work thank you so much

1 Like

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.