Does anyone have experience with Teamcenter searches using NXOpen? What I am trying to do is look in Teamcenter for component revisions greater than the currently loaded revisions and get their release status. Currently I have a working method of doing this, but it is incredibly slow. What I do currently is ask if a certain item/rev/status exist and if not ask if the same item/rev exists at a different status. Status will always be one of three options(Production, Development, or Working) so I only have to ask twice. This process takes quite a while in an assembly with lots of components with several newer revisions though. Does anyone have a better suggestion?
Function TCQuery(qItem As String, qRevision As String, qStatus As String) As Boolean
Dim entries() As String = {"item_id", "item_revision_id", "release_status_list.name"}
Dim values() As String = { qItem, qRevision, qStatus}
Dim mySearch As PDM.PdmSearch = theSession.PdmSearchManager.NewPdmSearch()
Dim mySearchResult As PDM.SearchResult = mySearch.Advanced(entries, values)
Dim results() As String = mySearchResult.GetResultObjectNames()
If results.Length <> 0
Return True
Else
Return False
End If
End Function