Filtering for exact string

Hello all,
I’m probably missing something easy here (or maybe it’s an easy script? learning python is still on my to do list)

I have been combing the forums but i don’t see anything applicable

So i have some parameters that include the same string.
i.e. height, clearance height, size-height

unfortunately I cannot change the family in Revit or i would just go that route.

So i am getting a parameter value by a string, but whenever i try to filter out the terms to just get the one i want (“height”) the value turns to “none”
when i do not filter i get the paramter that appears first on the list, which is incorrect (“clearance height”)

any suggestions?

thank you in advance for your time


What is the internal structure of the custom node?
Get Elements Parameter List and Show Unique Values

Hey @Ewan_Opie thanks for the reply. It is a bakery package, i would assume it is easier for you to look that way (because the nested nodes have some custom in them too). but if thats not doable let me know and i will dive down and reorganize the nodes so i can screenshot them

I think Ewan was basically getting at your list structure. The first image (using the filter) uses a list with a single item, whereas your second image uses just a singleton. The custom node may not be setup to handle inputs that way. Try using GetItemAtIndex like you did for the element to reduce your filtered list down to a single item.

1 Like

Don’t have the node installed ATM, hence the request to see inside.
@Nick_Boyts is correct with my assumption on list structures :+1:

I would suggest copying the internals of the node to your workspace to better interogate the issue, even if there are additional ‘nested’ nodes in there. (should be from the same package anyway)

thanks guys,
i’ll jump in there and try get item at index, I tried to flatten to a string (before i ran across this family i was just inputting the string “height” directly into the bakery node). I’m not sure why it’s giving me “none” instead of “null”. leads me to believe the data from revit is coming in the wrong way somehow?

anyways ill give it a shot.

sidenote - get parameter value by name node works as well but spits out a decimal, whereas the custom bakery node gives me a 0’ - 0" format so i was trying to utilize it for that reason to eliminate a bunch of nodes for conversion.

1 Like

ok so i tried a “get item at index” and the same problem happens. regardless of which index number i give it (1 or 0) it still defaults to the “clearance height” parameter.

do either of you know how to exclude “clearance” with a node? i though about maybe a len command? i cant write python script well enough to say something akin to "exclude any parameters that include anything additional to the word ‘height’ "

If GetParameterValueByName node works, you could try converting the decimal feet it gives you to fractional and see if that works for you. There’s a node in the Springs package for that.

@sed07 thank you that works. I’ll have to pressure test it against some different inputs but that will solve my problem for not thank you!

this is outputting to an annotation, so in order to use this node i have to split it to add the “-” between feet and inches with string split and combine so if anyone has another similar node that will accomplish this id preffer to keep the script as compact as possible (usually used many many times in a work session)

thanks for your help!!

You don’t have to split then combine, you can just insert whatever you want wherever you want.

Here I inserted " - " after the ' character. You can also do this with nodes, but using a codeblock makes it more compact.

1 Like

@sed07 thanks!! that works.

just 'cause i’m a nerd if you have time can you break out what the sytax does in that block? the overall makes sense, but i am not familiar with DScore.

if you dont have time, no worries, thanks much everyone for your help!!

Glad to hear it works.

I’m not an expert on the inner workings of this, but how I understand it is the DSCore is just meant to tell dynamo to use the definition of String from the original definitions of DesignScript (the language used in code blocks), since there might be several installed packages that use the same definition and it won’t know which one to use.