# 如何排除自定义的OdDbEntity实体不被选中？

 1. [FAQ](/cn/faq)
2. »
3. [.dwg support](/faq/dwg-support)

您可在OdDbSelectionSet查询中使用选择过滤器来排除不需要的实体：

代码实现：

```plaintext
/** \details
    Filter selection only.  

    \param vpId [in]  id of OdDbViewportTableRecord  record or OdDbViewport entity in which to select.
    \param nPoints [in]  Number of points into selection shape.
    \param wcsPts [in]  Selection shape as set of World Coordinate Space points.
    \param mode [in]  Selection mode.
    \param sm [in]  Subentities selection mode.
    \param pFilter [in] object of type OdDbSelectionFilter or pointer to a OdResBuf chain defining the filter.
  */
  static OdDbSelectionSetPtr select(
    const OdDbObjectId& vpId,
    int nPoints,
    const OdGePoint3d* wcsPts,
    OdDbVisualSelection::Mode mode = OdDbVisualSelection::kCrossing,
    OdUInt32 sm = OdDbVisualSelection::kDisableSubents,
    const OdRxObject* pFilter = 0);
```
