§
§選択時に ISelection インタフェースでオブジェクトをフィルタ
§AllowElement メソッド (要素のフィルタ)
§AllowReference メソッド (ジオメトリオブジェクトのフィルタ)
§
§
§
§
public void
SelectPlanarFaces(Autodesk.Revit.DB.Document document)
{
UIDocument uidoc = new UIDocument(document);
ISelectionFilter selFilter = new PlanarFacesSelectionFilter();
IList<Reference> faces =
uidoc.Selection.PickObjects(ObjectType.Face, selFilter, "Select multiple
planar faces");
}
public class
PlanarFacesSelectionFilter : ISelectionFilter
{
public bool AllowElement(Element
element)
{
return true;
}
public bool AllowReference(Reference
refer, XYZ point)
{
if (refer.GeometryObject is PlanarFace) { return
true; }
return false;
}
}