月更
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using System.Windows;
|
||||
using ShrlAlgoToolkit.Revit.Extensions;
|
||||
|
||||
namespace ShrlAlgoToolkit.Revit.Assists;
|
||||
|
||||
@@ -36,7 +38,18 @@ public static class ViewExtensions
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BoundingBoxXYZ GetElementsBox(this View view, List<ElementId> elementIds)
|
||||
{
|
||||
BoundingBoxXYZ box = new BoundingBoxXYZ();
|
||||
var doc = view.Document;
|
||||
doc.Invoke(ts =>
|
||||
{
|
||||
var group = doc.Create.NewGroup(elementIds);
|
||||
box = group.get_BoundingBox(null);
|
||||
ts.RollBack();
|
||||
}, "打组");
|
||||
return box;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取多个元素的包围框
|
||||
|
||||
Reference in New Issue
Block a user