Code:
Option Strict Off
Imports System
Imports NXOpenModule NXJournal
Dim theSession As Session = Session.GetSession()
Sub Echo(ByVal output As String)
theSession.ListingWindow.Open()
theSession.ListingWindow.WriteLine(output)
theSession.LogFile.WriteLine(output)
End Sub
Sub Main()
Dim entries() As String = {"item_id", "object_type"}
Dim values() As String = {"*00212*", "ItemRevision"}
Dim mySearch As PDM.PdmSearch = theSession.PdmSearchManager.NewPdmSearch()
Dim mySearchResult As PDM.SearchResult = mySearch.Advanced(entries, values)
Dim results() As String = mySearchResult.GetResultObjectNames()
Echo("found " & results.Length & " objects")
Dim cnt As Integer = 0
For Each resultName As String In results
cnt = cnt + 1
Echo(cnt & ". object_name = " & resultName)
Next
End Sub
End Module