ArcObjects Library Reference  (GeoDatabase)    

ISelectionSet.Combine Method

Combines this selection set with another selection set using the specified set operation.

[Visual Basic 6.0]
Sub Combine(
    ByVal otherSet As ISelectionSet, _
    ByVal setOp As esriSetOperation, _
    resultSet As ISelectionSet _
)
[Visual Basic .NET]
Public Sub Combine ( _
    ByVal otherSet As ISelectionSet, _
    ByVal setOp As esriSetOperation, _
    ByRef resultSet As ISelectionSet _
)
[C#]
public void Combine (
    ISelectionSet otherSet,
    esriSetOperation setOp,
    ref ISelectionSet resultSet
);
[Java]
public void combine (
    ISelectionSet otherSet,
    esriSetOperation setOp,
    ISelectionSet resultSet
)
throws
    IOException,
    AutomationException
[C++]
HRESULT Combine(
  ISelectionSet* otherSet,
  esriSetOperation setOp,
  ISelectionSet** resultSet
);
[C++]

Parameters

otherSet [in]

  otherSet is a parameter of type ISelectionSet

setOp [in]

  setOp is a parameter of type esriSetOperation

resultSet [out]

  resultSet is a parameter of type ISelectionSet

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

Used to combine to SelectionSets.  The resultSet parameter must be a third selection set and not any of the ones that are combined. For example, if you want to combine A and B and put the result in A, you must combine A and B into C, and then set A to C.

To combine two selection sets, the sets must be derived from the same table or feature class. Attempting to combine selection sets from different datasets will raise an error.

[Visual Basic 6.0]

This short example shows how to combine two SelectionSets using VB. Assuming pSelSet1 and pSelSet2 are valid SelectionSets and we want to put the result in pSelSet1:
 
  ...
  Dim pSelSet3 As ISelectionSet
  pSelSet1.Combine pSelSet2, esriSetUnion, pSelSet3
  Set pSelSet1 = pSelSet3
  ...

Trying to shortcut this with this syntax will give you an error.

  pSelSet1.Combine pSelSet2, esriSetUnion, pSelSet1 ' wrong syntax

See Also

ISelectionSet Interface

Example

ISelectionSet Example