Materials from Rhino to Revit using Rhino.Inside?

New to Rhino.Inside here - I am working on creating a family inside Revit based on a furniture polysurface in Rhino. I have managed to get a very basic level of the family set up and showing in Revit, but I am struggling with getting the assigned materials in Rhino to translate into Revit. I’m wondering if this is even possible? I have tried a few different scripts and no luck. I know I can just create a new material in the family once it is in Revit, but it feels like extra unnecessary work to have to create a replica of the materials that are existing in Rhino. Trying to streamline workflow so hoping there is a solution for this!

Hi Kimberly, Welcome to RiR, feel free to ask questions.

The Component Family Form takes the material, which is added to the New Component Family.

1 Like

Yep, the Component Family form is also a good place to add sub-category to elements that will make up that new family.

1 Like

Thank you so much for this! Does this only apply though if the material name already exists within Revit? I’m still unable to get the material information to go from Rhino to Revit. Trying with a very simple table, hopefully these pictures will help better explain where I am getting stuck.


table in Revit

1 Like

Gotcha, Revit Materials are pretty complex and the Rhino Materials don’t cast into Revit materials.

There are a couple things we can do.

  1. Add a Revit Material from the Rhino Layer Name and Color (requires elefront)
  2. Add a Revit Material using Convert Shader to Material Component (requires Human)

I’m looking at other options as well, haven’t had Material questions in a while and some things have changed.

1 Like

Hmm I see, well that’s good to know because I was starting to feel a little crazy not being able to get it to work! Tried to incorporate the reference layer and color but still no luck. Will have to manually adjust materials through the families in the meantime. Most RiR tutorials I’ve found seem to cover much larger architecture aspects, and I’ve been able to create a set for translating walls, floors, columns, beams, ceilings, and simple furniture from Rhino to Revit, but are there any other helpful resources you may be able to point me in the direction to? Thanks!

See below for one way of creating a revit material and assigning color from a Rhino Layer.

in a workflow environment, where you are dynamically adding layers and expecting the Revit to create the materials from them a slightly different approach would be needed.

This identifies the Layers that haven’t been made into materials yet. Currently if the a material already exists and if Element Tracking is enabled it will throw an error if you try to create a material with the same name.

If you aren’t too familiar with Grasshopper these tutorials are a must.

3 Likes

I had started sketching out something regarding translating Rhino Materials to Revit Materials as well.

I wrote a quick and dirty (emphasis on dirty) python component that extracts all the relevant properties I could find in the RhinoCommon Material, Texture and RenderMaterial documentation.

I was able to get the basics, but have hit a wall on getting any transforms applied to the material itself (not the object that it is applied to).

Where would I find this info?

In the texture’s UvwTransform?
R0=(0.338666666666666,0,0,0), R1=(0,0.343182222222223,0,0), R2=(0,0,1,0), R3=(0,0,0,1) If so, are they in standardized units different from the file’s?

Python code for posterity:

from Rhino.RhinoDoc import ActiveDoc

# Is this the correct way to access the material table?
# Should I prefer RenderMaterial over Material?
mat_table = ActiveDoc.Materials
mat_index = mat_table.Find(mat_name, True)

bitmap_table = ActiveDoc.Bitmaps

if mat_index >= 0:
    mat = mat_table[mat_index]
    name = mat.Name
    ambient_color = mat.AmbientColor
    diffuse_color = mat.DiffuseColor
    emission_color = mat.EmissionColor
    specular_color = mat.SpecularColor
    fresnel_reflections = mat.FresnelReflections
    fresnel_index_of_refraction = mat.FresnelIndexOfRefraction
    index_of_refraction = mat.IndexOfRefraction
    reflection_color = mat.ReflectionColor
    reflection_glossiness = mat.ReflectionGlossiness
    reflectivity = mat.Reflectivity
    refraction_glossiness = mat.RefractionGlossiness
    shine = mat.Shine
    transparency = mat.Transparency
    transparent_color = mat.TransparentColor
    
    bitmap_texture = mat.GetBitmapTexture()
    if bitmap_texture and bitmap_texture.Enabled:
        # Old Way? >> bitmap_texture_path = bitmap_table.Find(bitmap_texture,False).filename
        bitmap_texture_path = bitmap_texture.FileReference.FullPath
        # R0=(0.338666666666666,0,0,0), R1=(0,0.343182222222223,0,0), R2=(0,0,1,0), R3=(0,0,0,1)
        print mat.Name, bitmap_texture.UvwTransform
        print bitmap_texture.WrapU, bitmap_texture.WrapV, bitmap_texture.WrapW
        print bitmap_texture.TextureType
        
    bump_texture = mat.GetBumpTexture()
    if bump_texture and bump_texture.Enabled:
        bump_texture_path = bump_texture.FileReference.FullPath
        bump_texture = mat.GetBumpTexture()

    environment_texture = mat.GetTransparencyTexture()
    if environment_texture and environment_texture.Enabled:
        environment_texture = environment_texture.FileReference.FullPath

    transparency_texture = mat.GetTransparencyTexture()
    if transparency_texture and transparency_texture.Enabled:
        transparency_texture_path = transparency_texture.FileReference.FullPath
1 Like

I find that somethings that should be fairly simple do, requires so much effort that it defeats the purpose of using rhino to do any of this process. I wish grasshopper developer will think simpler way to do this mundane thing. One rhino plugin that I have been looking into is conveyor that seem to understand how addon should be like. Not everyone is a programmer and not everything process should require rocket science.

2 Likes