56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
|
|
using Autodesk.Revit.DB;
|
|||
|
|
using Autodesk.Revit.DB.Architecture;
|
|||
|
|
using Autodesk.Revit.UI.Selection;
|
|||
|
|
|
|||
|
|
namespace GeologyToolkit
|
|||
|
|
{
|
|||
|
|
internal class SelectTopographySurface : ISelectionFilter
|
|||
|
|
{
|
|||
|
|
public bool AllowElement(Element elem)
|
|||
|
|
{
|
|||
|
|
return elem is TopographySurface;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public bool AllowReference(Reference reference, XYZ position)
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal class SelectLayer : ISelectionFilter
|
|||
|
|
{
|
|||
|
|
public bool AllowElement(Element elem)
|
|||
|
|
{
|
|||
|
|
if (elem is FamilyInstance)
|
|||
|
|
{
|
|||
|
|
var instance = (FamilyInstance)elem;
|
|||
|
|
if (instance.Symbol.FamilyName.Contains("钻孔土层"))
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public bool AllowReference(Reference reference, XYZ position)
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal class SelectReferPoint : ISelectionFilter
|
|||
|
|
{
|
|||
|
|
public bool AllowElement(Element elem)
|
|||
|
|
{
|
|||
|
|
return elem is ReferencePoint;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public bool AllowReference(Reference reference, XYZ position)
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|