<xml> </xml>

SOLIDWORKS PDM Professional API Help | Send Feedback
CreateSearch2 Method (IEdmVault21)
See Also

Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: Visual Basic Language Filter: C# Language Filter: C++/CLI

EPDM.Interop.epdm Namespace > IEdmVault21 Interface : CreateSearch2 Method (IEdmVault21)

Visual Basic
C#
C++/CLI
Creates an interface to a search object.

# Syntax

Visual Basic |
--- | ---

    Function CreateSearch2() As IEdmSearch5

C# |
--- | ---

    IEdmSearch5 CreateSearch2()

C++/CLI |
--- | ---

    IEdmSearch5^ CreateSearch2();

#### Return Value

IEdmSearch5

# Example

See the IEdmVault21 examples.

# Remarks

This method creates a search object that allows you to search files and folders using multi-variable conditions, logical operators, and special search syntax. Once this search object is instantiated, special search syntax is allowed in all IEdmSearch* properties and method parameters. (See Search Syntax.)

To perform a search:

1. Cast the returned IEdmSearch5 to IEdmSearch9.

2. Add a single variable search condition using IEdmSearch8::AddVariable2. The new search allows you to specify the poValue parameter using special search syntax and eliminates the need to specify the lEdmVarOp parameter.

3. Add a multi-variable search condition using IEdmSearch9::AddMultiVariableCondition. Special search syntax applies.

4. Use the special search syntax in IEdmSearch5::FileName, IEdmSearch5::VersionComment, IEdmSearch5::State, and IEdmSearch6::SetToken.

5. Call IEdmSearch5::GetFirstResult. If no results are returned, either nothing was found or there were search syntax errors.

6. If step 5 returns no results, then see if there are search syntax errors by calling IEdmSearch9::GetSyntaxErrors. (Note: no syntax errors are reported unless advanced specifiers were placed before each search syntax.)

7. If step 5 returns results, call IEdmSearch5::GetNextResult repeatedly to get further results.

C++ users must release the returned pointer, IEdmSearch5.

Return codes:

- S_OK: The method successfully executed.

# See Also

####

IEdmVault21 Interface
IEdmVault21 Members

# Availability

SOLIDWORKS PDM Professional 2020