Copy Text From Sheet To Sheet

Hi all!

I am trying to copy a text from one sheet to multiple sheets so that it will be set with the same format.

When applying TextNot.ByLocation it copies the text but not the format.

I am trying to write a python script but I keep getting an error.

import clr

 
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')


import Autodesk 
from Autodesk.Revit.DB import * 

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication 
app = uiapp.Application 
uidoc = uiapp.ActiveUIDocument

points = IN[0] if isinstance(IN[0],list) else [IN[0]]
ogText = UnwrapElement(IN[1])
text = IN[2]

viewId = uidoc.ActiveView.Id

formText = ogText.GetFormattedText()

#Begin transaction
try:
    TransactionManager.Instance.EnsureInTransaction(doc)
    
    newTexts = []
    for p in points:
        textOpt = TextNoteOptions()
        xyz = p.ToXyz(True)
        newText = TextNote.Create(doc,viewId,xyz,text,textOpt)
        
        newText.SetFormattedText(formText)
        newTexts.append(newText)       

#End transaction
finally:
    TransactionManager.Instance.TransactionTaskDone()



OUT = newTexts

With this script I am trying get the format of existing text using the GetFormattedText(), create a text and then set the format using SetFormattedText.
I am getting the following error:

I tried inputing the formText(.GetFormattedText()) instead of TextNoteOptions in the Create method as chatgpt suggests but still am getting error…

I’d suggest you either use tags or legends in Revit for this.

Text is dumb (not BIM) and best avoided where possible.

If you have chunks of text you want to repeat you can put it in a legend and make sure it’s identical across sheets.

There is an inbuilt paste options in Revit that might actually do this for you.
I’m not able to check now but the “Aligned to selected views” i think works for sheets as well as views.