using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.Attributes;namespace XY工具集
{[Transaction(TransactionMode.Manual)][Regeneration(RegenerationOption.Manual)]class ForTest : IExternalCommand{public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements){//从commandData中取到DocumentUIDocument uidoc = commandData.Application.ActiveUIDocument;Document doc = uidoc.Document;try{//执行的代码return Result.Succeeded;//返回值}catch (Exception ex){message = ex.ToString();//错误提示信息messagereturn Result.Failed;//返回值}}}
}