Tag Archives: arcgis

ArcGIS Add in Config.esriaddinx

In ArcGIS 10, the add-in package does not automatically build a workable xml config file for you. You have to add the follow piece of code in yourself between the Tags.


        <Button class="[exact name of button file]" 
                caption="[shown in addin manager]" 

          <Help heading="">Help</Help>



Use ArcScene tags, for example, if it is an add in for ArcScene.
For toolbox, declare all button tags first. And then Add tag.
Do not use “&” in your xml file.


It is necessary to declare a Zaware for a 3d point before the Z value can be defined.

Dim pPoint1 As IPoint
Set pPoint1 = New Point
pPoint1.PutCoords 1, 1
Dim pZAware As IZAware
Set pZAware = pPoint1
pZAware.ZAware = True
pPoint1.z = 11.1

ArcGIS Intersections

Dim pTopo As ITopologicalOperator
Set pTopo = pF1.Shape ‘ store the line 1 shape in the topo op
If Not pTopo.IsSimple Then pTopo.Simplify
Dim pGeom As IGeometry
Set pGeom = pTopo.Intersect(pF2.Shape, esriGeometry0Dimension) ‘ get intersection with line 2
If pGeom.IsEmpty Then
MsgBox “The intersection of the 2 geometries is empty or consists of points”
Exit Sub
Dim ppcl As IPointCollection
Set ppcl = pGeom
MsgBox ppcl.Point(0).X & “, ” & ppcl.Point(0).Y
End If

esriGeometry0Dimension are points (IPointCollection)
esriGeometry1Dimension are lines (IPolyline)
For more information:

Getting a user’s selected feature in ArcGIS VBA/VB.NET

Dim pFL2 As IFeatureLayer
Set pFL2 = pMap.Layer(0)

Set pF2 As IFeature

Dim pfs As IFeatureSelection
Set pfs = pFL2
Dim id As Long
id = pfs.SelectionSet.IDs.Next
Set pF2 = pFL2.FeatureClass.GetFeature(id) ‘ this is line 2

Then you can do stuff on the Ifeature pF2 and pf2.Shape