laptop and a wrench

Error

The sample IMultiPatch_QueryFollowingRings_Example crashes.

Última publicación: August 25, 2014 No Product Found
Número de ID del error NIM012089
EnviadoOctober 2, 2007
Última modificaciónJune 5, 2024
Relacionado conNo Product Found
Versión encontrada9.2
Lenguaje del programaC#
Versión corregida9.3
EstadoFixed

Solución alternativa

This code may be used to replace the sample IMultiPatch_QueryFollowingRings_Example. It works around the three issues identified: //Get the map document IMxDocument mxDocument = _mapDoc; //Get the features selection IEnumFeature selectedFeatures = mxDocument.FocusMap.FeatureSelection as IEnumFeature; //Loop over all selected features and look if it is a polygon //* FIX 3 IEnumFeatureSetup pEnumFeatureSetup; pEnumFeatureSetup = (IEnumFeatureSetup) selectedFeatures; // 'QI pEnumFeatureSetup.AllFields = true; // FIX 3 */ selectedFeatures.Reset(); IFeature currentFeature = selectedFeatures.Next(); while (currentFeature != null) { //Check if currentFeature is multipatch if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryMultiPatch) { IMultiPatch multiPatch = currentFeature.Shape as IMultiPatch; int ringType = 0; //* FIX 1 ringType = (int)esriMultiPatchRingType.esriMultiPatchBeginningRingMask; // FIX 1 */ int beginningRingsCount = multiPatch.get_BeginningRingCount(ringType); if (beginningRingsCount > 0) { IRing[] beginningRings = new IRing[beginningRingsCount]; IGeometryBridge geometryBridge = new GeometryEnvironmentClass(); geometryBridge.QueryBeginningRings(multiPatch, ringType, ref beginningRings); //* FIX 2 int totalFollowingRingsCount=0; for (int i = 0; i < beginningRings.Length; i++) { int followingRingsCount = multiPatch.get_FollowingRingCount(beginningRings[i]); if (followingRingsCount > 0) { IRing[] followingRings = new IRing[followingRingsCount]; geometryBridge.QueryFollowingRings(multiPatch, beginningRings[i], ref followingRings); totalFollowingRingsCount = totalFollowingRingsCount + followingRings.Length; } } System.Diagnostics.Debug.WriteLine("Feature with OID = " + currentFeature.OID + " has " + beginningRings.Length + " inner Rings and " + totalFollowingRingsCount + " following Rings"); // FIX 2 */ } else { System.Diagnostics.Debug.WriteLine("Feature with OID = " + currentFeature.OID + " has " + " 0 inner Rings and 0 following Rings"); } } currentFeature = selectedFeatures.Next(); }

Pasos para reproducir

ID del error: NIM012089

Software:

  • No Product Found

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga