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是一个非常常用的功能,码一段带选择过滤器的框选,效果是直接无视非指定 类 型。
| Name | Description | |
|---|---|---|
| Releases all resources used by the Selection/释放内存。 | ||
| Returns the ids of the elements that are currently selected. 选择得到ElementId。 | ||
| Invokes a general purpose two-click editor that lets the user to specify a rectangular area on the screen.两种框选类型。 | ||
| Invokes a general purpose two-click editor that lets the user to specify a rectangular area on the screen.在左下角增加提示。 | ||
| Prompts the user to select multiple elements by drawing a rectangle. | ||
| Prompts the user to select one object. | ||
| Prompts the user to select one object which passes a custom filter. | ||
| Prompts the user to select one object while showing a custom status prompt string. | ||
| Prompts the user to select one object which passes a custom filter while showing a custom status prompt string. | ||
| Prompts the user to select multiple objects. | ||
| Prompts the user to select multiple objects which pass a customer filter. | ||
| Prompts the user to select multiple objects while showing a custom status prompt string. | ||
| Prompts the user to select multiple objects which pass a custom filter while showing a custom status prompt string. | ||
| 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. | ||
![]() |
Prompts the user to pick a point on the active work plane. | |
![]() |
Prompts the user to pick a point on the active work plane while showing a custom status prompt string. | |
![]() |
Prompts the user to pick a point on the active work plane using specified snap settings. | |
![]() |
Prompts the user to pick a point on the active work plane using specified snap settings while showing a custom status prompt string. | |
![]() |
Selects the elements.高亮选中状态 |
| Name | Description | |
|---|---|---|
![]() |
Specifies whether the .NET object represents a valid Revit entity. 免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删 |