Workset IDs - Lists and Integers

Hi all, I’m trying to sort elements onto particular worksets but something isn’t working. If I use a direct integer it works fine. However I want to be able to input the workset name and get Dynamo to retrieve the appropriate Workset ID. The script looks like it should work, it’s finding the correct value, but when it’s fed into the Set Parameter node it only affects the first item in the list. Can anyone tell me what I’m doing wrong?

Hi Keith,

I think you just need to change the Lacing of your Element.SetParameterByName node from ‘Shortest’ to ‘Longest’.

Or put a List.FirstItem between the Filter… and the SetParameter…

Cheers,

David

 

Awesome - thanks.

It’s funny, it makes perfect sense using the List.FirstItem it just hadn’t occured to me exactly how the code was being interpreted. It feels like a great way to start to learn about the basics of coding.

Cheers

K.

Could have sworn this worked earlier now I’m getting the following error

 

the best overloaded method match for ‘Revit.Elements.Element.SetParameterValue(Autodesk.Revit.DB.Parameter, double)’ has some invalid groups

what am I doing wrong?

Odd, it works fine in 2015…