Unable to change text

Hello. I’m trying to use Dynamo to find and replace text in a Revit project. The last node, TextNote.SetText is giving the error that it “expects argument type(s) (TextNote, string), but was called with (string, string).” Any ideas?

Welcome!
The error says you should have connected actual TextNote element (Revit Element) to the textNote input, but you have connected the string of the text note. Instead of filtering the strings by bool mask, go ahead and filter the text notes themselves.

2 Likes

to clarify @habdirad answer

You have probably got something like an ‘All Elements of Category’ node cut off on the left
(it would be useful to see the whole graph)

You wire the elements output of that node into the List.FilterByBoolMask list input

Also- you know Revit has it’s own find/replace text tool ?

1 Like

Andrew thanks. Here’s a pic of the entire graph. Is it wired up correctly?

Yes, I’m aware of Revit’s find/replace tool. I was trying to add this as another task within a bigger graph.

Thanks habdirad. How would I filter the text notes themselves? Sorry, I’m pretty new to Dynamo.

Also, see my response to Andrew below. I’ve included a pic of the entire graph.

Thanks

Just connect the output of All Elements Of Category node to the input list of List.FilterByBoolMask.

A common mistake with the filterbyboolmask is that they filter the parameter they are checking instead of filtering the actual element. You just need the string text for the boolean mask input but the thing you want to actually filter is the text notes.

That’s it! Thank you!
Yes, that makes total sense. Duly noted.

kennyb6 said the same thing you did but a little more explicitly - and that solved it. I didn’t realize I needed to go DIRECTLY from elements to the boolmask. But it makes perfect sense.
Thank you! Problem solved.