Hello I created this definition to bring in a rhino model element with direct shape and I created a material parameter to apply to the Direct Shape. I now notice, that not only does my direct shape have this material parameter but so does every other model element in my project. How do I apply this parameter to just my direct shape?
This is what my script looks like below and I also attached it.
Hi Olivia, DirectShapes are a little different and only take a material as a Paint, not parameter based. The Material Parameter you are adding to the Project won’t be applied to the DirectShape Geometry.
Creating Families allows you to have Instance based material parameters.
Oh that is really interesting. Thank you for confirming this. So is there a way to create a family and import my geometry through that family so the imported rhino geometry can show up with that parameter? If so could you point me to a script on that? Many thanks.
Can you describe the workflow & desired outcomes a bit?
It looks like you are bringing a custom wall, if we do this with the family its going to require placement locations and manually associating the Instance Family Parameter to the geometry in the family.
Hello Japhy, I set this example up as a way to vet the issue. My actual project is a set of stairs that I would like to bring in. So as I understand I need to use an add family component and create a custom stair template for that component I can see how to do that here: (11) Create custom family templates in Revit using Rhino.Inside.Revit - YouTube
Is this correct? I am testing out some things now I have this laid out below
The Add Family seems to take issue with the Built in Category picker. Am I on the right track? I think I am suppose to use a “Model Category Picker” for the Category input but I can’t find that component.
Once I get this setup can I apply a material parameter to this? If so how?
I see in examples on your resources you are using a “model category picker” but I can’t find that exact picker and all other alternatives seem to not work. Right now its a generic model.
To setup and then create the association of family parameters via the Revit API is possible but has a lot of variables and needs to be done in the Family Document. Assigning the material (not as an associated family parameter) is easy in RiR, but adding a shared or family parameter and associating programmatically to particular breps in families is complex and not often requested.
Hello Japhy, thank you for this workflow. I have two more questions regarding this. I noticed that the script below that imported my geometry last week no longer pulls in my geometry into my Revit file. Shouldn’t this script below import my brep?
thank you Japhy, The error in the add Family component is “1. The input category id cannot be assigned as the new category for this family.
Parameter name: categoryId” This still shows up if I unplug the file template file so I don’t think that is the conflict.
this is a new file with a different template from the other day so in the mean time. I am going to try to recreate the same exact environment to see if this still happens.
Hello Japhy, I tried out this same script in other revit files and it seems to work. I am not sure why this one revit file is not accepting the geometry like the others.
So now I only have two challenges.
I am not sure how to properly set the family category
I am not sure where to place the element parameter in my script so it will show up in my property panel as I select the family. I am fine with this being an instance parameter. I recreated the element parameter similarly to how you showed it earlier.
Ok this solution makes a lot of sense. So initially my hope was that I could load a family into my main Revit file with its own parameter. It seems like to make the material parameter side of it work correctly though, the “Add Parameter” component needs to run in an isolated Revit family session.