Does anybody have an arcObjects sample that will list the connect folders a user has created?
This is as close as I've got;
Dim pGxObjCont As IGxObjectContainer
Dim pGxCatalog As IGxCatalog
pGxCatalog = New GxCatalog
If pGxCatalog Is Nothing Then
Exit Sub
Else
pGxObjCont = pGxCatalog
End
If
Dim pEnumGxObj As IEnumGxObject
pEnumGxObj = pGxObjCont.Children
Dim pGxObj As IGxObject
pGxObj = pEnumGxObj.Next
Do While Not pGxObj Is Nothing
If pGxObj.Name = "Folder Connections" Then
'### Get the individual folders here
End If
pGxObj = pEnumGxObj.Next
Loop
Solved! Go to Solution.
I was able to get a list of the folders using the below code. You'd need to convert it to VB.net.
I was able to get a list of the folders using the below code. You'd need to convert it to VB.net.
Thanks Freddie that is really appreciated.
VB.Net version of the code below.
Dim booHdrive As Boolean = False
Dim pGxObjCont As IGxObjectContainer
Dim intFolders As Integer
Dim pGxCatalog As IGxCatalog
pGxCatalog = New GxCatalog
If pGxCatalog Is Nothing Then
Exit Sub
Else
pGxObjCont = pGxCatalog.GetObjectFromFullName("Folder Connections", intFolders)
End If
Dim pEnumGxObj As IEnumGxObject
pEnumGxObj = pGxObjCont.Children
If Not pEnumGxObj Is Nothing Then
Dim pGxObj As IGxObject
pGxObj = pEnumGxObj.Next
Do While Not pGxObj Is Nothing
If pGxObj.FullName = "H:\" Then
booHdrive = True
End If
pGxObj = pEnumGxObj.Next
Loop
End If
Hi Chris,
Looks like you got a solution but from one developer to another your formatting is not very helpful so it was difficult to read the code. You seem to have about 4 to 5 blank lines between every line of code...
Can you reformat it to make it more readable for others?
Duncan
The format was messed up when I pasted the code in. I'd actually already tidied it up a bit!
I've given it a bit of a tidy up.
Regards
Chris
Thanks! Much easier to read now.