BIM二次开发小白第一次写过滤选择出墙实例,编译没有问题但在Revit里运行没有任何反应,求教各位!

代码想要实现对Revit中墙实例的过滤选择,以下是代码部分:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.UI;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.UI.Selection;

namespace 元素过滤器
{
    [Transaction(TransactionMode.Manual)]
    public class Class1 : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIDocument uidoc = commandData.Application.ActiveUIDocument;
            Document doc = uidoc.Document;
            FilteredElementCollector wallTypeCollector1 = new FilteredElementCollector(doc);
            ElementFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_Walls);
            wallTypeCollector1.OfClass(typeof(Wall)).WherePasses(filter);


            //将过滤得到的图元转化为Id
            IList<ElementId> elId = new List<ElementId>();//对墙类型进行列表集合
            int im = 0;
            foreach (Element el in wallTypeCollector1)
            {
                elId.Add(el.Id);
                im = im + 1;//循环累加计数
            }
            uidoc.Selection.SetElementIds(elId);//将图元设置为选中状态为高亮显示
            TaskDialog.Show("查看结果", "墙的数量为" + im.ToString());

            return Result.Succeeded;

        }
    }
}