Can dynamo fill in parameter values?

I recently was able to get dynamo to select certain elements with a certain parameter. Is there a way to run dynamo to fill in the text value for that specific parameter? such as a different number value for each instance i have? if this is possible are we able to add a common prefix to all the numbers added? I have attached what i have so far. Thanks!

You can use the Element.SetParameterByName node to write a new value to that element.

2 Likes

Wow @bmsewell u really simplified what i had. For some reason when i do the final connection it begins to process and then causes my dynamo and revit to crash. Can u explain the Prefix code block to me? when i input the “x” i get different options, should i select one of these?

THe prefix code block is inserting the string “Pre-Fab Box#” before the existing parameter value for “Pre-Fab Box#”.

Simplify it further by wiring the left most All Elements of Category node into the element input for the ELement.SetParamterByName.

How large is your dataset (number of electrical fixtures in this case)?

Its very small, im using a test project with 25 electrical fixtures and only 13 have the “Pre-Fab Box#” parameter. I was hoping to get this working and be able to use it for a few hundred fixtures in an actual project. I cant figure out what dynamo doesnt like here to cause the crash. Could it be because the parameter is a created shared parameter?

So i changed the run to manual and i have my prefixes working. Getting an error for the set parameter by name. It is saying no parameter found by that name.

Make sure the code block that contains the name of the parameter that you are trying to set matches exactly how it appears in Revit. It is case sensitive.

Just verified that and it looks good. Could it be that i need to filter out the Electrical Fixtures that do not contain that parameter before connecting to the set parameter by name?

Yes, that should work.

Would i use a list clean somewhere?

You can filter the elements by the parameter value. Remove all elements from the list where the value is null.

Hmm cant seem to get it to filter. Still seeing my null values for some reason.

write a parameter’s value.dyn (15.8 KB)
@bmsewell I copied your flow but I get the following error: “NO paramter founf by that name”. Can you help me please?