Revit 外部命令範例 using System; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using CHC.Enum; using CHC.Tools; namespace CHC.MepToolsCommand { [Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] [Journaling(JournalingMode.NoCommandData)] public class SelectTubeToPlaceThrough : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { try { MepCurveClassification curveClassification = MepCurveClassification.Pipe | MepCurveClassification.Conduit; return RunSelectTubeToPlaceThrough.Execute(commandData, ref message, elements, curveClassification); } catch (Exception e) { message = e.Message; return Result.Failed; } } } }