laptop and a wrench

Bug

The sample IMultiPatch_QueryFollowingRings_Example crashes.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM012089
SubmittedOctober 2, 2007
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.2
Program languageC#
Version Fixed9.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(); }

Steps to Reproduce

Bug ID: NIM012089

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options