Category Archives: ArcObjects with Visual Basic

Switch on labels

key interfaces: ILabelEngineLayerProperties, IAnnotateLayerProperties
Continue reading

Advertisements
Posted in ArcObjects with Visual Basic | Leave a comment

Dissolve

The following VB 6.0 sub- procedure can be used to dissolve features based upon desired attribute fields: – Public Sub GPDissolve(strIn, strOut, disField As String) On Error GoTo EH Dim GP As IGeoProcessor Set GP = New GeoProcessor GP.OverwriteOutput = … Continue reading

Posted in ArcObjects with Visual Basic | Leave a comment

Calculate sum of the lengths of selected Polylines

The following code is useful to get a sum of selected Polyline features :- Sub CalcLength() Dim pMxD As IMxDocument Set pMxD = ThisDocument Dim pMap As IMap Set pMap = pMxD.FocusMap Dim pEnumFeat As IEnumFeature Set pEnumFeat = pMap.FeatureSelection … Continue reading

Posted in ArcObjects with Visual Basic | Leave a comment

Dissolve a group layer in ArcMap TOC

There are two ways to implement this: – 1. Use IUngroupLayerOperation to UNGROUP your layers so that the group is removed while layers remain. However, there is no sample code to implement IUngroupLayerOperation. 2. In the second approach, you can … Continue reading

Posted in ArcObjects with Visual Basic | Leave a comment

How to extract installed ArcGIS version?

The following code can be utilized to get to know installed ArcGIS version: – Public Function GetArcGISVersion() As String On Error GoTo Err Dim WScr As Object Set WScr = CreateObject(“WScript.Shell”) Dim sVer As String sVer = WScr.RegRead(“HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGIS\RealVersion”) GetArcGISVersion = … Continue reading

Posted in ArcObjects with Visual Basic | Leave a comment