laptop and a wrench

Bug

The sample IMultiPatch_QueryFollowingRings_Example crashes.

Zuletzt veröffentlicht: August 25, 2014 No Product Found
Bug-ID-Nummer NIM012089
EingereichtOctober 2, 2007
Zuletzt geändertJune 5, 2024
Gilt fürNo Product Found
Gefunden in Version9.2
ProgrammspracheC#
Behoben in Version9.3
StatusFixed

Workaround

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

Schritte zur Reproduzierung

Bug-ID: NIM012089

Software:

  • No Product Found

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln