Method to search for where used results with the help of windows based indexing
mechanism.
Visual Basic |
---|
Public Function FindWhereUsedDocuments( _ ByVal DocumentPathName As Variant, _ ByRef DocumentsUsedByList As Variant _ ) As Object |
Imports System.IO Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim application As DesignManager.Application = Nothing Dim strPath As FileInfo = New FileInfo("D:\Large Assembly\Part1.par") Dim arrDocUsed() As Object Try application = New DesignManager.Application() application.Visible = True application.WhereUsedCriteria(Nothing, True) = "D:\Large Assembly" application.FindWhereUsedDocuments(strPath, arrDocUsed) Catch ex As System.Exception MsgBox(ex.ToString) Finally application.Quit() End Try End Sub End Class
using System; using System.Windows.Forms; using System.IO; public class Form1 { private void Button1_Click(object sender, EventArgs e) { DesignManager.Application application = null; FileInfo strPath = new FileInfo("D:\\Large Assembly\\Part1.par"); object[] arrDocUsed = null; try { application = new DesignManager.Application(); application.Visible = true; application.WhereUsedCriteria(null, true) = "D:\\Large Assembly"; application.FindWhereUsedDocuments(strPath, arrDocUsed); } catch (System.Exception ex) { MessageBox.Show(ex.ToString()); } finally { application.Quit(); } } }