Autodesk.Revit.UI.Selection

public static IList<Element> GetManyRefByRectangle(UIDocument doc)
{
    ReferenceArray ra = new ReferenceArray();
    ISelectionFilter selFilter = new MassSelectionFilter();
    IList<Element> eList = doc.Selection.PickElementsByRectangle(selFilter, 
        "Select multiple faces") as IList<Element>;
    return eList;
}

public class MassSelectionFilter : ISelectionFilter
{
    public bool AllowElement(Element element)
    {
        if (element.Category.Name == "Mass")
        {
            return true;
        }
        return false;
    }

    public bool AllowReference(Reference refer, XYZ point)
    {
        return false;
    }
}

Selection是一个非常常用的功能,码一段带选择过滤器的框选,效果是直接无视非指定类型。

Methods

 NameDescription
 Dispose

Releases all resources used by the Selection/释放内存。

 GetElementIds

Returns the ids of the elements that are currently selected.

选择得到ElementId。

 PickBox(PickBoxStyle)

Invokes a general purpose two-click editor that lets the user to specify a rectangular area on the screen.两种框选类型。

 PickBox(PickBoxStyle, String)

Invokes a general purpose two-click editor that lets the user to specify a rectangular area on the screen.在左下角增加提示。

 PickElementsByRectangle()(String)(ISelectionFilter)(ISelectionFilter, String)

Prompts the user to select multiple elements by drawing a rectangle.

 PickObject(ObjectType)

Prompts the user to select one object.

 PickObject(ObjectType, ISelectionFilter)

Prompts the user to select one object which passes a custom filter.

 PickObject(ObjectType, String)

Prompts the user to select one object while showing a custom status prompt string.

 PickObject(ObjectType, ISelectionFilter, String)

Prompts the user to select one object which passes a custom filter while showing a custom status prompt string.

 PickObjects(ObjectType)

Prompts the user to select multiple objects.

 PickObjects(ObjectType, ISelectionFilter)

Prompts the user to select multiple objects which pass a customer filter.

 PickObjects(ObjectType, String)

Prompts the user to select multiple objects while showing a custom status prompt string.

 PickObjects(ObjectType, ISelectionFilter, String)

Prompts the user to select multiple objects which pass a custom filter while showing a custom status prompt string.

 PickObjects(ObjectType, ISelectionFilter, String, IList<(Of <<'(Reference>)>>))

Prompts the user to select multiple objects which pass a custom filter while showing a custom status prompt string. A preselected set of objects may be supplied and will be selected at the start of the selection.

Public methodPickPoint()()()()

Prompts the user to pick a point on the active work plane.

Public methodPickPoint(String)

Prompts the user to pick a point on the active work plane while showing a custom status prompt string.

Public methodPickPoint(ObjectSnapTypes)

Prompts the user to pick a point on the active work plane using specified snap settings.

Public methodPickPoint(ObjectSnapTypes, String)

Prompts the user to pick a point on the active work plane using specified snap settings while showing a custom status prompt string.

Public methodSetElementIds

Selects the elements.高亮选中状态

Properties

 NameDescription
Public propertyIsValidObject

Specifies whether the .NET object represents a valid Revit entity.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值