start
[Transaction(TransactionMode.Automatic)]
[Regeneration(RegenerationOption.Automatic)]
public class theTransaction : IExternalCommand
{
    
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
    {
        UIApplication uiApp 
= commandData.Application;
        Document doc 
= uiApp.ActiveUIDocument.Document;

        Transaction ts 
= new Transaction(doc, "事务");
        ts.Start();

        
//添加代码,若有失败则回滚

        ts.Commit();

        
return Result.Succeeded;
    }
}
end

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案