Trouble Assigning Material Parameters with Rhino.Inside

parameter problems.gh (15.1 KB)
I am having trouble applying a material parameter to my Direct Shape import into Revit using Rhino.Inside.Revit. This is the main part below:


I used this exact same script just a few months ago and it worked perfectly. Now I am getting an error:

  1. Parameter ‘floor material’ is not defined in ‘Element’

Is there a new process for assigning parameters?
thank you for the help,
Olivia

What’s the error?

This worked for me, but adding a material parameter like isn’t going to change your Direct Shape material, it can be scheduled but isn’t related to the geometry.

If for instance i change the material to Earth, the floor material is still the one applied in shaded mode and controlled by the Material Creation definition.

Direct Shapes can have a material applied but there isn’t a Parameter for it.

If you want that functionality you will need to use a Revit Floor in this case, or Revit Families with material parameters on the shapes.

Perhaps I am wrong here, but I think if materials as an appearance asset. So I create a new aperance asset and assign that to the element? Rhino.Inside®.Revit

I can test it tomorrow.

You can paint the faces of a Direct Shape in Revit UI but they don’t have a parameter to change the materials to the Element. Direct Shapes can be assigned the material on creation or controlled by the Category it’s assigned to.

Hello @Japhy and @scott. Thank you for looking into this issue. My main goal here is to have a material parameter show up in revit under my properties panel when I select my element as shown below:
image

I recreated @Japhy 's script above exactly and I still get this error form the Element Parameter component " 1. Parameter ‘material name’ is not defined in ‘Element’ "

The only difference I can see between our scripts is this element:
image
located between the material and direct object. What is this component called?

I used this exact same script a few months ago and it created a new parameter in Revit for me as shown in that screen shot above. what next steps can I take to trouble shoot.

thank you again for the continuing help.

The only thing i do to make your definition work is add a box for the geometry (you didn’t internalize the brep). I am on a recent build, lets make sure your Rhino.Inside.Revit is at least the latest Stable release. There have been changes in error handling.

You can add the parameter, but like i mentioned above, it doesn’t actually change the material of the Revit Brep in this case.

I tried the internalizing step. I still get this 1. Parameter ‘material name’ is not defined in ‘Element’ from my Element Parameter.

I did notice something interesting though: when I go into Family Type the material does show up as shown here:
image

In the past it would also show up on the properties panel though.

Could you share your exact file so I can compare apples to apples?

I downloaded yours and added a box. You are using direct shapes in your definition, not families.

Olivia -

I think I see where the trouble is. Here is the final definition that works:

You can see the value also shows on the Project Parameter too for the element:

I can try and explain what is going on:

  1. This is a directshape vs a built in Floor Family. So, the Material needs to be assigned directly to the directshape and is not part of the Floor Category as it might be for System Family Floor types.
  2. The Parameter that is being created is a Project Parameter called “Floor Material Test” with a datatype of a Material. So the Material needs to be assigned to that parameter. For instance, a String with the name of the material is not enough. You can see in the definition the actual material is plugged in as a value to the parameter. If the name of the material was plugged in then it would throw and error.

I guess another way to put this is that the material can be assigned to the directshape, but the material also needs to be assigned to the project parameter also. Without Grasshopper, it is possible for someone to change the directshape material and the project parameter would not change automatically. To change the material in Revit on the Directshape the Paint Face UI would need to be used. And to change the Parameter Value you would need to use the material picker on the Parameter Panel.

Does that help?

Thank you for this detailed explanation. I believe I understand what you are saying. I have recreated your this script exactly as it is shown on your side.


It looks like we are both assigning the material to our direct shape and the parameter. I am still getting the same error even though everything looks exactly the same. I attached my grasshopper script. I am wondering if it works on your side?
param still not working.gh (12.0 KB)

Olivia, please add an Add Parameter Component after your Define Parameter, Scott must of already created it in the file.

1 Like

Yep, sorry to be confusing. I had created the parameter previously then just accidentally used it. The steps should be:

  1. Create Parameter definition
  2. Use the definition to create a parameter with the correct scope. (Instance in this case)
  3. Assign the parameter value to the element instance.
1 Like

This is such a weird bug >

I swear, I just reopened that same exact file re plugged in my directshape (didn’t even use add parameter component to change the def. into a parameter) and it works just like it did a few months ago.

I guess its fixed for now? I will use the add parameter as suggested though for good measure.

Thank you @Japhy and @scott for all your help on this.

I think parameters have been updated as no Revit let’s us do more with them. So they have changed a bit.

1 Like