Home > Net >  Revit secondary development
Revit secondary development

Time:04-03

Beginners revit secondary development, the following section of code, generate error-free, perform no response, is the problem that code?

using System;
. Using Autodesk Revit. DB;
. Using Autodesk Revit. UI;
. Using Autodesk Revit. Attributes;

The namespace HelloRevit
{[Transaction (TransactionMode. Manual)] public class Class1: IExternalCommand {public Result the 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); }}} to return the Result. Succeeded; }}
}
  •  Tags:  
  • C#
  • Related