search of the set expression and its replacement by another in the drawing

Hi, I ask forgiveness for my English.
I need to make a code which has to touch each element of assembly and carry out the following:
1. Search in attributes of the file the set expression, for example the "TEST 1", will also replace it with the "TEST 2".
2. Search in the field of the drawing the set expression, for example the "TEST 1", will also replace it with the "TEST 2".
3. to export the changed drawing to pdf.
I will be very grateful for any answer.

Are you searching for a particular expression or attribute? I don't understand what it is that you are trying to replace.

I want to find particular expression , which is in two locations:
1. File Attributes
2. The text of the drawing obtained by "preferences-annotation".

What version of NX?

8.5