Hello,
I am having an issue with a duplicated parameter. The parameter was wrongly called as another built in parameter, so i cannot really choose which one i want to apply the value for, since revit forces me to go for the built in parameter.
Was wandering if there’s any way of setting a parameter value based on the element and the parameter id instead of the parameter name.
Many thanks for your help!
Unfortunately the Parameter Id would have to come from that specific parameter, so you’d already have what you need in order to even get there. You can do the opposite instead though: Get the BuiltInParameter’s Id and then check that against the two parameters on the element. Filter out the match (the built in) and then set the other parameter’s value.
Thank you. Fair enough, but i am wondering what the method for setting the parameter by the id is, not how to retrieve the id. Does it make sense?
You can only set the parameter value to the parameter element as that is the object that actually contains the value. You can get the parameter element directly from the Id though. But how do you plan on getting the parameter Id without knowing which parameter is the correct one?
Thanks, appreciate it. Still i am struggling to understand how in dynamo i can set up a value for an instance of a family using the parameter id.
Get the element parameters and filter by Name. That should give you the builtin parameter and the custom one. Most builtin elements have negative ids, so you can get the element ids from your two parameters and filter for the one that’s positive ( > 0). That will be your custom parameter.
I was able to get the ids, but i don’t know how to use them to set the parameter value for the instance.
You need to show us what you’re doing. Otherwise we’re just going to keep guessing. There’s a Parameter.SetValue
node but that requires the parameter. You should be getting the Id from the parameter itself. So then you can filter the parameter by Id.