ERROR
When using the IRelationalOperator::Equals method on a geometry bag, ArcMap returns the message, "Run-time error '445' - Object doesn't support this action".
This is a known issue. This method is not implemented yet.
Code:
'*****************************************
'If you have a geometry bag
'*****************************************
Dim pGeometryBag As IGeometryCollection
Set pGeometryBag = New GeometryBag
'*****************************************
'And you add some geometries to this bag
'*****************************************
pGeometryBag.AddGeometry pPt
pGeometryBag.AddGeometry pPolygon
'*****************************************
'The work around can be:
'*****************************************
*Create IEnumGeometry Interface
Dim pGeomEnum As IEnumGeometry
*Set that inteface to the geometry bag
Set pGeomEnum = pGeometryBag
*Create a geometry interface
Dim pGeom As IGeometry
Dim count As Integer
*Create the relational operator
Dim pRelOperator As IRelationalOperator
*Loop in your geometry enumeration and
*extract each geometry and compare with
*another geometry
For count = 1 To pGeomEnum.count
Set pGeom = pGeomEnum.Next
Set pRelOperator = pGeom
MsgBox CStr(pRelOperator.Equals(pPt(0), vbOKOnly)
Next
Get help from ArcGIS experts
Download the Esri Support App