本示例介绍了Revit的错误处理. #region Namespaces using System; using System.Collections.Generic; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; #endregion namespace ErrorHandling { […
在本例中,通过命令可以删除选中的元素. 需要注意的是要在代码中加入Transaction,否则的话会出现Modifying is forbidden because the document has no open transaction的错误. #region Namespaces using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; usin…