Usage of Element.SetParameterByName with filtered list

First of all, I’m pretty sure that it’s an easy to solve problem.
Sadly I’m not that advanced in Dynamo yet.

What the script should do:

  1. Get all elements with the parameterName “Systemabkürzung”
  2. Filter for the searched parameter value “L-”
  3. Change the value of parameters with the parameter “Parametername” to “101”.

How can I get the element thats connected to the List.GetiItemAtIndex-node?
The element Id’s should be highlited in green and it’s possible to retrieve the elements categories.
But why not the element itself?

Thanks for your help.
Greetings,
David

Hello, here is a possibility to get the items of a certain category from a set of items


We don’t see your nodes on your image
Cordially
christian.stan

What is the error on what I assume is the Element.SetParameterValueByName node (lower right corner of your screenshot)?

If you expand the warning by hovering you can take a screenshot via windows snipping tool if you add a delay.

See the pictures below:

Thats the input side:

There Error message is telling you that the element doesn’t have a parameter named “Parametername”.

Select the first element in the list inside your Revit project to confirm it has a parameter named “Parametername” - it should show in the properties pallet, not the ElementType dialog as you are working with elements not element types.

If it doesn’t show, everything else will often fail unless your lacing is set to circumvent the issue (it isn’t right now which is fine). You may want to add a second filter for the objects to get rid of anything which doesn’t have a Parametername parameter.

If you are looking to set the Element Type value you’ll have to work with ElementTypes not instances.

I looked up the right names and it works without warnings. :sweat_smile:
But now it won’t change/ overwrite the parameter values.

Are you getting a warning? A sample data set and your dyn would help - you can hsot to a 3rd party stie like dropbox, gogle drive, box, onedrive, etc.

I’d like to do so. But since it’s work related I can’t share this data. :confused:
But it won’t overwrite existing values.

Best to build a new sample dataset that you and others can test on.

1 Like