修改命名空间

This commit is contained in:
GG Z
2026-02-21 16:31:24 +08:00
parent 97c0b18dc7
commit 2ad3d0fde0
188 changed files with 783 additions and 2710 deletions

View File

@@ -0,0 +1,47 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
namespace ShrlAlgoToolkit.RevitCore.Assists;
/// <summary>
/// 获取当前模型或链接模型的实体元素
/// </summary>
public class ElementInLinkOrCurrentDocument : ISelectionFilter
{
public ElementInLinkOrCurrentDocument(Document doc)
{
this.doc = doc;
}
private readonly Document doc;
public bool LastCheckedWasFromLink => null != LinkedDocument;
public Document LinkedDocument { get; private set; }
public bool AllowElement(Element e)
{
return true;
}
public bool AllowReference(Reference r, XYZ p)
{
LinkedDocument = null;
var e = doc.GetElement(r);
if (e is RevitLinkInstance li)
{
LinkedDocument = li.GetLinkDocument();
e = LinkedDocument.GetElement(r.LinkedElementId);
}
return e != null
&& e.CanHaveTypeAssigned()
&& e.HasPhases()
&& e.get_BoundingBox(null) != null
&& e.Category is { Parent: null }
&& e is not Panel;
}
}