I perform several actions such as creating architectural walls, creating PythonParts, and deleting 3D objects. However, when I close the tool, there are three separate undo steps. The user has to click Undo three times to revert everything.

I want to merge them into a single undo step. I tried using the CollectElementsForMultipleTransactions function, but it doesn’t work.

Can anyone help me with a solution?