交互选择
2017-09-29 本文已影响0人
辉呀辉呀骄傲放纵
Revit把所有交互选择都封装在selection中,selection中有几种方法,分别是

Pick....是执行命令之后选择
GetelementIds是执行命令之前选择,并传入图元Id
SetelementIds是执行命令之后,根据所传入的Id选中图元。
被框选又被分为3种,crossing指图元被部分框选时就被选中(从右下往左上框选时)
encrossing指图元被全部框选时才被选中(从左上往右下框选时)
direction根据方向来判断,若从右下往左上即crossing,若从左上往右下
即encrossing.
1.PickBox

2.PickElementsByRectangle



3.PickObject


4.PickPoint

5.GetElementsId
添加代码TaskDialog.Show("title", uidoc.Selection.GetElementIds().Count.ToString());
实现如图所示效果
