Когда пишется плагин на .Net, то для класса, реализующего интерфейс IExternalCommand ОБЯЗАТЕЛЬНО должен задаваться атрибут Transaction. Выглядит примерно так:
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class Revit_LintelsCommand : IExternalCommand
{
//.....
}
Атрибут имеет три варианта:
Automatic
The API framework will create a transaction on the active document before the external command is executed and the transaction will be committed or rolled back after the command is completed (based upon the return value of the ExternalCommand callback).
Manual
The API framework will not create a transaction (but will create an outer group to roll back all changes if the external command returns a failure status). Instead, you may use combinations of transactions, sub-transactions, and groups. You will have to follow all rules regarding use of transactions and related classes. You will have to give your transactions names, which will then appear in the undo menu. Revit will check that all transactions (also groups and sub-transaction) are properly closed upon return from an external command. If not, it will discard all changes to the model.
ReadOnly
No transaction (nor group) will be created, and no transaction may be created for the lifetime of the command. The External command may use methods that only read from the model, but not methods that write anything to it. Exceptions will be thrown if the command either tries to start a transaction (or group) or attempts to write to the model.
По идее у вас тоже должно быть что-то подобное. Я просто не знаком с питоном.
Вот
еще тема на что-то похожее вашему вопросу, где тоже говорится о транзакциях
Все-таки, мне кажется, что проблема где-то вокруг транзакций вертится.
Правда я не сталкивался еще с закрытием видов, поэтому могу только выдвигать предположения