Getting Value out of a Shared Parameter

I am trying to get a python to give me the value of my shared parameters. As you can see in the first image, my element has a Shared Parameter called Conduit_Run_Name and it has a value of T_SVC_TO_SWB.

But if you look at the second picture you can see that, while python can find this parameter in my element, it only ever gives me null. I do have some elements that have the value set to null but not all of them.

I have tried a few diffrent ways to solve this problem but they all basically give me the same answer that none of my elements have any sort of value in this parameter. What might my problem be?

Can you show the rest of your graph (and the rest of your python code if it’s not just the output of the usable_conduit list). You would get null values if the parameter doesn’t exist.

That is the entirety of my python code. The only thing I do before the python code is pull all the conduits and fittings from revit, create a list, and then flatten that list. Dynamo does grab all the elements, and looking at the parameters, as shown in the first picture, the parameter does exist and does have a value.

Also, when I try and use the Element.GetParameterValuesByName block, it does find the parameter because I don’t get an error, but it give me a list of empty values

Can you show us where the parameter exists within the Revit interface? Does it show in the instance properties or the type properties? Where are you getting the first image from?

That’s how Dynamo acts when it can’t find the parameter. It won’t return an error.

Hi @AAHelixElectric

Try modifying this way:

run_id = conduit.LookupParameter('Conduit_Run_Name').AsString()

I’m not proud to admit this but my error was a spelling mistake in Revit. I misspelled Conduit, so while my Dynamo and Python code was write and spelled correctly, it could find it in Revit. Sorry everyone, and thanks for all the quite responses anyway.

1 Like