laptop and a wrench

Bug

The IConditionalOp.SetNull() method returns a COM error when using grayscale and binary raster in ArcObjects 10.6.1 add-in.

Last Published: September 26, 2019 ArcObjects SDK
Bug ID Number BUG-000120354
SubmittedFebruary 26, 2019
Last ModifiedJune 5, 2024
Applies toArcObjects SDK
Version found10.6.1
StatusWill Not Be Addressed

Additional Information

In ArcGIS SDK, certain changes had been made in Spatial Analyst extension. It is highly recommended that users to update their code accordingly. Detailed information can be found here: https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#DataProcessingInSpatialAnalysisOperations.htm An alternative way is to using geoprocessing to work with add-ins, here is more information on this topic: https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#RunToolsInsideAnAdd-In.htm

Workaround

Use these lines of code:With error:pConditionalOp.SetNull(pLogicalOp.BooleanNot(pLogicalOp.IsNull((IGeoDataset)pRasterDataset)) as IGeoDataset, (IGeoDataset)_pDEM);No error:pConditionalOp.SetNull(pMathOp.Float(pLogicalOp.BooleanNot(pLogicalOp.IsNull((IGeoDataset)pRasterDataset))) as IGeoDataset,

Steps to Reproduce

Bug ID: BUG-000120354

Software:

  • ArcObjects SDK

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