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.
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.
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.
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.
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)