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