Iselection,过滤器

#region 梁过滤器
class BeamISelection : ISelectionFilter
{
    public bool AllowElement(Element elem)
    {
        Categories categories = elem.Document.Settings.Categories;
        if (elem is FamilyInstance && elem.Category.Id == categories.get_Item(BuiltInCategory.OST_StructuralFraming).Id)
        {
            return true;
        }
        else
        {
            return false;
        }
        ;//返回true时内容可被鼠标选定
    }
    public bool AllowReference(Reference reference, XYZ position)
    {
        return true;//返回true时表示内容可以被边、点、面选中
    }
}
#endregion

}

猜你喜欢

转载自blog.csdn.net/waiting233/article/details/117653715