Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found this function online and need some help modifying it. As it stands it will create a DKS and set it to the top of the search order. But I do not want to create one. I just want to move (switch to) an existing one to the top of the list. If I call the function with a name that does not already exist it will create the DKS and place it at the top of the list. If I call the function with a name that DOES already exist, nothing happens.
Private Function createOrRetrieveDescriptionKeySetAndForce(name As String) As ObjectId
Dim curDb As Database = Active.Database
Dim keySets As PointDescriptionKeySetCollection = PointDescriptionKeySetCollection.GetPointDescriptionKeySets(curDb)
Dim searchOrder As ObjectIdCollection = keySets.SearchOrder
If keySets.Contains(name) Then
Return keySets(name)
End If
Dim newKeySetId As ObjectId = keySets.Add(name)
searchOrder.Insert(0, newKeySetId)
keySets.SearchOrder = searchOrder
Return newKeySetId
End Function
Solved! Go to Solution.