laptop and a wrench

Bogue

The sample IMultiPatch_QueryFollowingRings_Example crashes.

Dernière publication: August 25, 2014 No Product Found
Numéro d’ID de bogue NIM012089
EnvoiOctober 2, 2007
Dernière modificationJune 5, 2024
S’applique àNo Product Found
Version trouvée9.2
Langue du programmeC#
Version de correction9.3
StatutFixed

Solution de contournement

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(); }

Étapes pour reproduire

ID de bogue: NIM012089

Logiciel:

  • No Product Found

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement