Solid Edge Framework Type Library
FindWhereUsedDocuments Method
Solid Edge Framework Type Library > Application Object : FindWhereUsedDocuments Method
Solid Edge Document for which you need to look for Where Used results.
- Expected complete path.
- Can be network/local location
- Can be from indexed/or non indexed location
Example –
   C:\OS-UI\Part1ASM.par
Directories where we want to search for Where Used results.
- Scope of where used query
- Multiple paths are allowed.
- Can be network/local location
- Folder can be indexed/non-indexed as well
Flag to indicate whether subdirectories needs to be searched or no for finding the results.
List mentioning about extensions to be considered as Where Used Results.
Description
Find where used for given files.
Syntax
Visual Basic
Public Function FindWhereUsedDocuments( _
   ByVal DocumentPathName As Variant, _
   ByRef psalistOfDirectories() As Variant, _
   ByVal IncludeSubFolders As Boolean, _
   ByRef psaFilterList() As Variant _
) As Variant
Parameters
DocumentPathName
Solid Edge Document for which you need to look for Where Used results.
- Expected complete path.
- Can be network/local location
- Can be from indexed/or non indexed location
Example –
   C:\OS-UI\Part1ASM.par
psalistOfDirectories
Directories where we want to search for Where Used results.
- Scope of where used query
- Multiple paths are allowed.
- Can be network/local location
- Folder can be indexed/non-indexed as well
IncludeSubFolders
Flag to indicate whether subdirectories needs to be searched or no for finding the results.
psaFilterList
List mentioning about extensions to be considered as Where Used Results.
Example
Imports System.Runtime.InteropServices
Imports System.IO

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApp As SolidEdgeFramework.Application = Nothing    
        Dim arrDirs(0 To 1) As Object
        Dim docPath As FileInfo = New FileInfo("D:\Large Assembly\Part1.par")
        Dim arrFilterList(0 To 1) As Object
        Dim arrResults() As Object
        Try
            ' Get the application with specific settings
            objApp = Marshal.GetActiveObject("SolidEdge.Application")
            arrDirs(0) = "D:\Large Assembly"
            arrFilterList(0) = "*.asm"
            arrFilterList(1) = "*.dft"
            arrResults = objApp.FindWhereUsedDocuments(docPath, arrDirs, True, arrFilterList)
           
        Catch ex As Exception
           
        Finally
           
        End Try

    End Sub
End Class
using System;
using System.Runtime.InteropServices;
using System.IO;

public class Form1
{

    private void Button1_Click(object sender, EventArgs e)
    {
        SolidEdgeFramework.Application objApp = null;
        object[] arrDirs = new object[2];
        FileInfo docPath = new FileInfo("D:\\Large Assembly\\Part1.par");
        object[] arrFilterList = new object[2];
        object[] arrResults = null;
        try
        {
            // Get the application with specific settings
            objApp = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
            arrDirs[0] = "D:\\Large Assembly";
            arrFilterList[0] = "*.asm";
            arrFilterList[1] = "*.dft";
            arrResults = objApp.FindWhereUsedDocuments(docPath, arrDirs, true, arrFilterList);

        }
        catch (Exception ex)
        {

        }
        finally
        {

        }

    }

    public Form1()
    {
        SubscribeToEvents();
    }

//Converted event handler wireups:
    private bool EventsSubscribed = false;
    private void SubscribeToEvents()
    {
        if (EventsSubscribed)
            return;
        else
            EventsSubscribed = true;

        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
        Button1.Click += Button1_Click;
    }

}
See Also

Application Object  | Application Members