Undo - how to set name of script/action

Hello pyRevit Community :slight_smile:

When using pyRevit tools i can see the name of the tool if I want to undo an action in revit. For example “Match graphic overrides”.

But my own tools give just the name “Sample Text”.

image

How can i set this name?

I´m using a .yaml file to set the name of my pushbuttons and it works just fine. Only this “undo name” is wrong.

Happy about any advice!
Kind Regards.

that is the transaction Name

with Transaction(doc,'TransactionName') as t1:
    t1.Start()
    t1.Commit()
1 Like

Ah, thank you so much, i knew i have seen this “sample text” somewhere! :smiley:

Let me add my 2 cents
When using

with revit.Transaction('name of the transaction'):

You don’t need a start and a commit. It is already wrapped in the revit.Transaction() of pyrevit module

5 Likes