I am using the SetParameter.by.name node to set type-parameter values, but notice that it gives an error when the parameter can not be changed, like if there is a formula attached or because of the parameter links .This is understandable.
Is there a way to ignore the error and return the file unchanged where the parameter cant be changed ?
If this is possible I can change different families with the same parameterName, eventhough 1 parameter is changeable and the other isnt.
Maybe this can be done in Python by modifying the node or a dynamo work around ?
Please help me Dynamo-community
Main goal:
use an excel file to change multiple family-parameters without getting error if the parameters in 1 or the other or not changeable. (red circle is unchangeable)
If i have to modify the family i will have to modify 60+ families. So my question is, can the node ignore errors and output the file unchanged instead of no file ?
I think that might be going against the “nature” of Revit. For a lot of read only parameters it’s often not even possible to change it even if isn’t a read-only parameter by the simply nature of how that parameter is put into the file.
Just Dynamo, by selecting the parameters using Parameter.ByName node, and filtering out both the parameters and values from the excel using the node Parameter.IsReadOnly.
Using python would be much compact and straight forward, I would do something like (pseudo-code):
...
parametersToChange = [] # these comming from the excel
for fam in families:
parameters = fam.GetOrderedParameters();
for param in parameters:
#if parameter is not ReadOnly and it is on the excel spreadsheet, change the value
if not param.IsReadOnly and param.Definition.Name in parametersToChange:
param.Set( value ) #value associated with that parameter and family from excel.
...
Finally finished and your advice worked perfectly. This is what the final part of the script looks like. I flattened one of the list so i didnt have to use the levels. Dont know why but i never seem to find the right level.