Get Latest IterationID by using the FileName

Get Latest IterationID by using the FileName

shashipatra
Contributor Contributor
428 Views
1 Reply
Message 1 of 2

Get Latest IterationID by using the FileName

shashipatra
Contributor
Contributor

Is there a way to Get Latest IterationID by using the FileName ?

I am able to get the list of File Names using the Search Criteria , I would like to get the Latest Released iteration ID for each file by passing the file Name.

 

Dim SrcCond AsNew SrchCond

 

      

' search for files

      

Dim fileList As List(Of File) = New List(Of File)()

      

Dim bookmark AsString = String.Empty

      

Dim status As SrchStatus = Nothing

 

      

With SrcCond

            .PropDefId = 8

            .SrchOper = 1

            .PropTyp = PropertySearchType.SingleProperty

            .SrchTxt = "488278"

      

EndWith

 

      

'Create a search condition array

      

Dim SrcConds(0) As SrchCond

        SrcConds(0) = SrcCond

      

With SrcCond2

            .PropDefId = 22

            .SrchOper = 3

            .PropTyp = PropertySearchType.SingleProperty

            .SrchRule = SearchRuleType.Must

            .SrchTxt = Boolean.TrueString

      

EndWith

 

        Array.Resize(SrcConds, SrcConds.Length + 1)

        SrcConds(SrcConds.Length - 1) = SrcCond

      

While (status IsNothingOrElse fileList.Count < status.TotalHits)

          

Dim files As File() = m_serviceManager.DocumentService.FindFilesBySearch​Conditions( _

               SrcConds,

Nothing, Nothing, True, True, bookmark, status)

          

If (Not files IsNothing) Then

                fileList.AddRange(files)

          

EndIf

      

EndWhile

 

      

If (fileList.Count > 0) Then

          

'iterate through found files and display them in the search results list box

          

ForEach file As File In fileList

              

'create the list item that will wrap the File

              

Dim fileItem As ListBoxFileItem = New ListBoxFileItem(file)

                m_searchResultsListBox.Items.Add(fileItem)

    

  ' Get Iteration ID for Each Item

 

          

Next file

      

Else

 

      

EndIf

0 Likes
429 Views
1 Reply
Reply (1)
Message 2 of 2

Daniel.Dulzo
Alumni
Alumni

The iteration ID is the Id field on the Autodesk.Connectivity.WebService.File class. This is the same class of objects returned in the collection by the FindFilesBySearchConditions() method, so you actually already have the iteration ID's for all the files found, you just need to access that field.



Daniel Dulzo
Software Engineer
Autodesk, Inc.
0 Likes