ArcObjects connected Folder

2999
5
Jump to solution
07-10-2015 07:57 AM
ChrisMatthews
New Contributor III


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

0 Kudos
1 Solution

Accepted Solutions
FreddieGibson
Occasional Contributor III

I was able to get a list of the folders using the below code. You'd need to convert it to VB.net.

folders.png

View solution in original post

5 Replies
FreddieGibson
Occasional Contributor III

I was able to get a list of the folders using the below code. You'd need to convert it to VB.net.

folders.png

ChrisMatthews
New Contributor III

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

DuncanHornby
MVP Notable Contributor

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?

ChrisMatthews
New Contributor III

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

DuncanHornby
MVP Notable Contributor

Thanks! Much easier to read now.

0 Kudos