public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
Selection sel = uidoc.Selection;
View view = commandData.View;
Element ele = doc.GetElement(sel.PickObject(ObjectType.Element, "选择构件"));
BoundingBoxXYZ boundingBox = ele.get_BoundingBox(view);
Transform transform = Transform.Identity;
BoundingBoxXYZ box = new BoundingBoxXYZ();
box.Transform = transform;
box.Min = boundingBox.Min;
box.Max = boundingBox.Max;
Transaction ts = new Transaction(doc, "创建围框");
ts.Start();
View3D view3D = View3D.CreateIsometric
(doc, new FilteredElementCollector(doc).OfClass(typeof(ViewFamilyType))
.Cast<ViewFamilyType>().Where(m =&
Revit二次开发-生成构件的三维剖面框
最新推荐文章于 2023-08-12 22:35:00 发布