Dealing with Worksets

I have a list of elements and i can retrieve the workset GUID using the Element.GetParameterValueByName. In this case i’m retrieving the Workset (i know some of you are already smiling ;))

Using Konrad’s node Get Workets I’mable to get a list of both the Id’s and the name.

Now i’m looking for a way to match the element value(Id’s) the list of names and write that to a text parameter.

 

And as usual any help is much appreciated :slight_smile:

Capture

First time I have ever seen anyone use the python script from string. Pretty cool Konrad!

Thanks Konrad :slight_smile:

I’m running that over walls but i’m not sure it makes a difference anyway. I’m getting an error message

Any idea whats going on? And thanks for the help :wink:

2015-05-12_09-51-39

One of the workset integer values returned by GetParameterByName is not on a list of worksets. I know that sounds a little silly: How is it possible that a wall is not on a workset? Well, I can’t see how exactly you are collecting all of your walls, but its possible that you got a Wall Category/Type in your collection? In that case when asked for a workset it will return -1 integer or some internal workset value (drafting elements dont reside on user worksets either for that matter).

All in all just check your list of values returned by the workset query and see if all items on that list are also present in the list returned by GetWorksets. GetWorksets only returns User Worksets, not internal.

Totally forgot to get back to you on that one sorry :frowning:

I was selecting the walls using Categories. Your script works like a charm obviously :slight_smile: The goal was to write the workset name in a parameter so it can be used to filter

 

Thanks for your help