Looking at parameter then adding a letter to another parameter

Hello everyone,

This is my second post here, and I would like to get your input

I’m trying to create a dynamo script that will do the following:

Looks at a revit parameter (Comments_1) if it has a value (HR), then I want to add letter ( – X) to a different parameter (Comments_2) while maintaining the parameter value

and if the parameter (Comments_1) doesn’t have (HR), I want to add letter ( – Z) to a different parameter (Comments_2) while maintaining the Parameter value

For example:

Comments_1: 2 HR

Comments_2: AA

Dynamo output

Comments_2: AA – X

Comments_1: 2 HT or no Value

Comments_2: AA

Dynamo output

Comments_2: AA – Z

As you can tell from below I didn’t make a lot of progress having hard time connecting the over all image

Thank you

Hi @AAbuYosof !
The beginning of your script is right.
Try List.FilterByBoolMask, String.Insert and then Element.SetParameterByName

Hi @Francois_Labonne

Thank you for your help

As you can see from the image below, I did what to recommended but I think I’m missing something

1- What I need to add to the script in order to have (Comments_2) includes ( – X) or ( – Z) if we don’t have (HR) in (Comments_1)

Now the list is divided in two :
-in : elemenst which contain HR
-out : the ones which doesn’t contains HR
Next step : connect the in and out output with two different SetParameter nodes

Before Dynamo:


After Dynamo:


It replaced everything in Comments_2 with (- S)

(1) I do have some with HT and some with no value not sure why it replaced everything (- S). The (- S) should be only for the HT and with no value

(2) I would like to keep the Comments_2 values and add the (- F) or (- S) at the end, but it look like it replacing the whole value with (- S)

Thank you

You have to connect the in and out output of the FilterByBooleanMask node with the two SetParameter. nodes.
And you have to do an other “branch” of your script to create the new values :
use Element.GetParameterValueByName and String.Insert

And you have to connect All Element of Category to List.FilterByBolleanMask, not Element.GetParameter

1 Like