jongarrido

ISimpleJunction

Discussion created by jongarrido on Apr 22, 2014
Latest reply on May 4, 2014 by jongarrido
I want to run this sample code just to manage the edges of a selected feature (junctionFeature)...

// Assume we already have a pointer to a junction feature.
ISimpleJunctionFeature simplejunctionFeature = junctionFeature;
IEdgeFeature edgeFeature;
IRow row;

for(int i = 0; i < simplejunctionFeature.EdgeFeatureCount; i++)
{
    edgeFeature = simplejunctionFeature.get_EdgeFeature(i);
    row = (IRow)edgeFeature;
    Console.WriteLine("EdgeFeature " + i + " has OID of: " + row.OID);
}


Well, first Im trying another code.

I have an IFeature selected . I have notice that when I hit a breakpoint for debbuging the FeatureType property of this element is esriFTSimpleJunction.

The code is this:


try 
                {
                    ISimpleJunctionFeature junction = firstSelectedFeature as ISimpleJunctionFeature; //firstSelectedFeature is my IFeature

                    staticUtilities.writeToDockableWindowJon(junction.EdgeFeatureCount.ToString()); //this just writes in my dockable window textbox...
                
                }
                catch (Exception ex) 
                
                {

                    staticUtilities.writeToDockableWindowJon(ex.ToString()); //this just writes in my dockable window textbox...
                }




The error is this:

System.Runtime.InteropServices.COMException (0x80004005): Error no especificado (Excepción de HRESULT: 0x80004005 (E_FAIL))
   en ESRI.ArcGIS.Geodatabase.ISimpleJunctionFeature.get_EdgeFeatureCount()...

Pleas help!!!

Thans in advance

Jon

Outcomes