The neck bones connected to the IName
Posted on 31. Jul, 2009 by Guido in Uncategorized
With the help of a developer friend in my office I was able to work my way through the ESRI resource page and pieced together enough code to reach my first programming goal:
Public Sub RemoveSpatialIndex()
Dim pGxApp As IGxApplication
Set pGxApp = Application
Dim pGxObject As IGxObject
Set pGxObject = pGxApp.SelectedObject
Dim pName As IName
Set pName = pGxObject.InternalObjectNameIf TypeOf pName Is IDatasetName Then
Dim pDatasetName As IDatasetName
Set pDatasetName = pNameIf pDatasetName.Category = “File Geodatabase Feature Class” Then
MsgBox pDatasetName.Category & vbNewLine & pGxObject.FullName
RunRemoveSIGeoProcess pGxObject.FullName
Else
MsgBox “Selected Item is not a File Geodatabase Feature Class”
End IfEnd If
End SubPublic Sub RunRemoveSIGeoProcess(InputString As String)
‘//Init the groprocessor
Dim GP As IGeoProcessor
Set GP = New GeoProcessorDim parameters As IVariantArray
Set parameters = New VarArray
parameters.Add (InputString)‘Execute the removespatialindex tool
GP.Execute “removespatialindex”, parameters, Nothing
End Sub
Ok… it’s really rough… but now I have something to say about this whole resource website thing…
- Why are all the searches opening a seperate window?
- Why isn’t their a way to re-open the TOC from the pages that search brings up?
So the good news is that the informatino and diagrams are out there, but the bad news is that it’s a little crazy trying to find what you need. It’s like ESRI wants you to take a class on how to navigate their website.
