# Find & Replace Text

**URL:** <https://forum.dynamobim.com/t/find-replace-text/31466>\
**Category:** FAQ\
**Created:** [January 31, 2019, 7:25am UTC](https://forum.dynamobim.com/t/find-replace-text/31466 "2019-01-31T07:25:46Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![nileshkatkar1983in](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nileshkatkar1983in](https://forum.dynamobim.com/u/nileshkatkar1983in)\
**Post date:** [January 31, 2019, 7:25am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/1 "2019-01-31T07:25:46Z")

</div>

Hello Guys,

I have created Dynamo graph to ‘Find & Replace’ specific text from revit model.  
If I run Dynamo graph, then it is showing proper output/result but in revit text value does not change.  
I want to change text value from ‘5001’ to ‘X1010’.  
Please advise.

Refer below images.

 ![Find%20%26%20Replace%20Text](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/9/69f0ffecf5c44695cd212010cb2333a1af0dd66c.jpeg)  
 ![Revit%20Model%20Image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/f/1ff80c01562f38468579bbd52a81548985809728.jpeg)  
[Find & Replace Text.dyn](https://forum.dynamobim.com/uploads/short-url/dI57sAaqcYDdQvdhNI1JOPyiMvX.dyn) (7.2 KB)

Thank you.

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 31, 2019, 7:29am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/2 "2019-01-31T07:29:21Z")

</div>

Your Dynamo graph just made a list of strings, you haven’t put it back onto the text notes. Try using the [SetText node](http://dictionary.dynamobim.com/#/Revit/Elements/TextNote/Action/SetText) to change the text of the text note.

---

<div class="post-metadata">

**Author:** ![nileshkatkar1983in](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nileshkatkar1983in](https://forum.dynamobim.com/u/nileshkatkar1983in)\
**Post date:** [January 31, 2019, 7:36am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/3 "2019-01-31T07:36:48Z")

</div>

Hello Ken,

Thank you for your advice.  
Not it is working perfect.

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 5:17am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/4 "2019-04-30T05:17:14Z")

</div>

Hi Nilesh & Ken,

I tried the method, however the result return null, let me know anything wrong with it ?

thank you

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/e/0e7e0a0b0dc3bd567eee4ddb29efd3367e85be6c.png)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [April 30, 2019, 5:46am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/5 "2019-04-30T05:46:31Z")

</div>

That node is meant to return a null, the output of the node itself says void. Check the Revit file and see if the text note’s text is updated.

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 5:49am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/6 "2019-04-30T05:49:17Z")

</div>

Hi Kenny,

I have checked , it doesn’t update, and there is no error, it say run completed

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/9/a9dece6f9eedefe5955826a9fde14c48c55fff95.png)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [April 30, 2019, 5:53am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/7 "2019-04-30T05:53:32Z")

</div>

Your graph is all kinds of confusing with how it is organized. Can you clean up the layout so wires aren’t crossing behind a bunch of different nodes and it is easier to read and show the outputs of each node?

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 5:56am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/8 "2019-04-30T05:56:29Z")

</div>

Sure , sorry bout that , here is the front and rear portion

also attached the dyn file

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/9/89549fa9781502ee557f6093dcf6619d206d50d6.png)

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/8/e8df50bf50ac6a8ed26e624a9073a3888c1bbf47.png) [Replace Text Note Content.dyn](https://forum.dynamobim.com/uploads/short-url/q2vZUZYyw0ifRa1qHvkdiNuHKEX.dyn) (34.9 KB)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [April 30, 2019, 6:00am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/9 "2019-04-30T06:00:12Z")

</div>

I think your problem is that the list of texts has been filtered a few times for which ones have “REMOVED” vs “REMOVE” but you never filtered the elements to the same mask. So instead of changing the text for the elements whose text has “REMOVE”, you are replacing the first 4 elements in All Elements of Category node.

Try adding a List.FilterByBoolMask using the same mask and use the All Elements of Category as the list input.

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 6:11am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/10 "2019-04-30T06:11:19Z")

</div>

I filtered twice because “REMOVED” was also containing “REMOVE” ,

I will try find another method to filter only once… and see how it goes…

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [April 30, 2019, 6:14am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/11 "2019-04-30T06:14:37Z")

</div>

The method you used was fine. The problem was that you did not filter the elements alongside the text. Just add a separate filter process using the elements as the input and the same mask that you used for the text.

I don’t have the package you used and the Revit file so I can’t test it out but something like this, the green group:

 ![settextnote](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/9/39d276038e312eaf2dbf0c415020bb756a3be978.png)

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 6:28am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/12 "2019-04-30T06:28:11Z")

</div>

That was from bakery package, I can try filter without the package node, and see whether it work …

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [April 30, 2019, 6:29am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/13 "2019-04-30T06:29:15Z")

</div>

I think you are misunderstanding your problem. The problem has nothing to do with that side of the graph. Don’t change anything you have right now.

What you need to do is just add the green group alongside what you have.

Please read this carefully and if you do not understand let me know: In your graph you filter the text inside the text notes to only find text that has “REMOVE”, not “REMOVED”. This works fine, do not change that.

But what this means is that the original list of text (not the text notes, just the text) has been filtered. In addition to this, you also must filter the actual text notes using the same filter you applied to the text. That is what the green group does.

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 6:37am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/14 "2019-04-30T06:37:35Z")

</div>

Hi Kenny,

Did the filter element along side, but still the same output… hmm

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/80e2e6f36697e6f4dafa8b38732297c5e44301fb.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/7/e7a7fdcfebd3608bc14ee1c50a5798967c56e3ff.png)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [April 30, 2019, 6:39am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/15 "2019-04-30T06:39:52Z")

</div>

And you have checked inside the Revit file that the text notes still say REMOVE instead of REMOVED? Like I said before, the output of the SetText node is supposed to be null, that should mean it was successful.

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 6:41am UTC](https://forum.dynamobim.com/t/find-replace-text/31466/16 "2019-04-30T06:41:38Z")

</div>

yup checked the revit file , still the same …

---

<div class="post-metadata">

**Author:** ![ck\_user](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@ck\_user](https://forum.dynamobim.com/u/ck_user)\
**Post date:** [April 30, 2019, 11:29pm UTC](https://forum.dynamobim.com/t/find-replace-text/31466/17 "2019-04-30T23:29:46Z")

</div>

Hi Kenny, your method worked, just need to filter the element along side

one thing is that text note cant be in a group.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/4/d478ce707df3a4f70e6a4b3fcf14838709fbb3f7.png)

---

<div class="post-metadata">

**Author:** ![TRoberts\_Gray](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/troberts_gray/32/133158_2.png) [@TRoberts\_Gray](https://forum.dynamobim.com/u/TRoberts_Gray)\
**Post date:** [March 3, 2022, 4:21pm UTC](https://forum.dynamobim.com/t/find-replace-text/31466/18 "2022-03-03T16:21:44Z")

</div>

I’ve been trying something that would allow me to remove all of the “.” from our abbreviated word in our drafting views, e.g. TYP. = TYP, STRUCT. = STRUCT, etc. Would I be able to use this to accomplish this?
