@myrwen.junterealSJC7 you are not going to be able to name the transaction using the TransactionManager
object because that is currently not supported. You can read the source code implementation of that class and you will see in it a TransactionName
variable set to a constant like so:
public static readonly string TransactionName = "Dynamo-51297CB5 Script";
Yes, that’s correct. Again looking at the source code at the link above you will discover two different transaction handling cases. One for Manual and one for Automatic. These are the two modes that Dynamo can be in:
Per those two modes, transaction is either commited (in manual mode) or it is simply kept open for the next run of Dynamo (automatic mode). I believe the reason why it is so, is to prevent a situation where Revit DB gets flooded with transaction commit requests so much that it crashes. So when Dynamo is in automatic, it won’t commit them all the time.
@myrwen.junterealSJC7 to name the transaction yourself you have to use the RevitAPI calls directly and skip the Dynamo wrappers. You can do that like so:
This will result in:
Pay special attention to the fact that I am using with
statement here. Just like in C# with a using
statement we are making sure to dispose of the transaction object when its done executing. Also, you will have to manually call Open
and Commit
to make sure that transactions are opened and closed.
Good luck!