revit二次开发的问题

hdztroop 2021-04-02 10:37:11
初学revit二次开发,下面一段代码,生成无错,执行无反应,是代码的问题吗? using System; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.Attributes; namespace HelloRevit { [Transaction(TransactionMode.Manual)] public class Class1 : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication revit = commandData.Application; ElementSet collection = new ElementSet(); ElementSet selWall = new ElementSet(); foreach (ElementId elementId in revit.ActiveUIDocument.Selection.GetElementIds()) { collection.Insert(revit.ActiveUIDocument.Document.GetElement(elementId)); foreach (Element ele in collection) { Wall wall = ele as Wall; if (wall !=null) { selWall.Insert(ele); } } } return Result.Succeeded; } } }
...全文
171 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zemkey 2021-04-03
  • 打赏
  • 举报
回复
感觉只是写了一个类,没有执行吧

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧