using Autodesk.Revit.DB; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FWindSoft.Revit { /// /// 事务扩展相关 /// public static class TransactionExtension { /// /// 开始事务并设定预处理 /// /// /// /// public static TransactionStatus StartWidthPreprocessor(this Transaction tran,IFailuresPreprocessor preprocessor) { FailureHandlingOptions failureOptions = tran.GetFailureHandlingOptions(); failureOptions.SetFailuresPreprocessor(preprocessor); tran.SetFailureHandlingOptions(failureOptions); return tran.Start(); } /// /// 以默认预处理开始事务 /// /// /// public static TransactionStatus StartWidthPreprocessor(this Transaction tran) { return StartWidthPreprocessor(tran, new ErrorWarningPreprocessor(false)); } } }