Error 000824 with Eliminate tool in ArcGIS Engine

3277
10
03-22-2014 06:51 AM
BaghdadAlAlavi
New Contributor
Hi all. I'm developing a standalone application with ArcGIS Engine in .Net environment.  I have license for engine + Spatial analyst + 3D Analyst. Everything works perfect ??? including clip, intersect, Select by attributes, Select By Location, ???. ??? except for Eliminate tool. This is my code for eliminate:
Dim InLayerPath, InLayerName As String
Dim pFDS As IDataset = pFL
InLayerPath = pFDS.Workspace.PathName
InLayerName = pFDS.Name

Dim GP As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New  ESRI.ArcGIS.Geoprocessor.Geoprocessor
Dim EliminateTool As New ESRI.ArcGIS.DataManagementTools.Eliminate
EliminateTool.in_features = InLayerPath & "\" & InLayerName & ".shp"    'like c:\a.shp 
EliminateTool.out_feature_class = OutFullPath             'input by user like c:\b.shp
        
Dim pGPResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
GP.OverwriteOutput = True
pGPResult = GP.Execute(EliminateTool, Nothing)


In the last line, I get HResult error of 2147467259. GP.GetMessages(2) gives me following description of this error:
"Failed to execute. Parameters are not valid. ERROR 000824: The tool is not licensed. Failed to execute (Eliminate). "
I'm nearly sure that that there is no problem with license, because in other areas of my code I can run other tools located in DataManagementTools toolbox, like select by location.
I've spent lots of hours to figure out the source of problem but without any solution.  Any help or tip would be greatly appreciated
Thanks in advance
0 Kudos
10 Replies
BaghdadAlAlavi
New Contributor
Hi again
I noticed another issue. As you know, for eliminate tool there must be a selected set of features available  in input feature layer. How can i tell eliminate geoprocessing tool that my layer has a selection. Usually, i just pass path of layer to geoprocessing tools so geoprocessing tools can not understand if a layer has selection or not.

Do you know how to specify a selection set of features for a geoprocessing tool?
0 Kudos
NeilClemmons
Regular Contributor III
Hi all. I'm developing a standalone application with ArcGIS Engine in .Net environment.  I have license for engine + Spatial analyst + 3D Analyst. Everything works perfect �?? including clip, intersect, Select by attributes, Select By Location, �?�. �?? except for Eliminate tool. This is my code for eliminate:

Dim InLayerPath, InLayerName As String
Dim pFDS As IDataset = pFL
InLayerPath = pFDS.Workspace.PathName
InLayerName = pFDS.Name

Dim GP As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New  ESRI.ArcGIS.Geoprocessor.Geoprocessor
Dim EliminateTool As New ESRI.ArcGIS.DataManagementTools.Eliminate
EliminateTool.in_features = InLayerPath & "\" & InLayerName & ".shp"    'like c:\a.shp
EliminateTool.out_feature_class = OutFullPath             'input by user like c:\b.shp
       
Dim pGPResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
GP.OverwriteOutput = True
pGPResult = GP.Execute(EliminateTool, Nothing)


In the last line, I get HResult error of 2147467259. GP.GetMessages(2) gives me following description of this error:
"Failed to execute. Parameters are not valid. ERROR 000824: The tool is not licensed. Failed to execute (Eliminate). "
I'm nearly sure that that there is no problem with license, because in other areas of my code I can run other tools located in DataManagementTools toolbox, like select by location.
I've spent lots of hours to figure out the source of problem but without any solution.  Any help or tip would be greatly appreciated
Thanks in advance


Here is the Help topic for the Eliminate tool:

http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000005p000000

At the very bottom, it states that an Advanced license is needed to run the tool.
0 Kudos
BaghdadAlAlavi
New Contributor
Here is the Help topic for the Eliminate tool:

http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000005p000000

At the very bottom, it states that an Advanced license is needed to run the tool.


Thanks a world, Neil, for your answer.
I'm nearly getting mad, spending lots of hours for just this tool.
As i know, advanced license means ArcInfo License and I have it.
In ArcGIS License Initializer (Project>Add ArcGIs License Checking in VS 2010) I have Checked ArcInfo and Engine Core. Moreover, i have checked the option "Shut down the application if any of licenses is not available" in that dialog. I can run my program without any problem, hence this indicates that there is no problem with license.

This is the code in Startup method (in ApplicationEvents.vb) which runs with no problem:

  
     'ESRI License Initializer generated code.
            If (Not m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeEngine, esriLicenseProductCode.esriLicenseProductCodeArcInfo}, _
            New esriLicenseExtensionCode() {esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst, esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork, esriLicenseExtensionCode.esriLicenseExtensionCodeSchematics, esriLicenseExtensionCode.esriLicenseExtensionCodeMLE, esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst, esriLicenseExtensionCode.esriLicenseExtensionCodeDataInteroperability, esriLicenseExtensionCode.esriLicenseExtensionCodeTracking})) Then
                MsgBox(m_AOLicenseInitializer.LicenseMessage() + vbNewLine + vbNewLine _
                + "This application could not initialize with the correct ArcGIS license and will shutdown.")
                m_AOLicenseInitializer.ShutdownApplication()
                e.Cancel = True
                Return
            End If



Any help or point that cames to your mind can be a great help for me.

Thanks again
0 Kudos
NeilClemmons
Regular Contributor III
I do not work with Engine applications anymore so I am unfamiliar with how the licensing works now.  The way that it used to work is it would try checking out the licenses you specified in the order you specified them until a checkout was successful.  At that point it would quit checking out licenses.  You are specifying the Engine license first, so perhaps it's stopping once that license is checked out.  If you have ArcGIS Desktop on the machine, then you don't need the Engine license at all so for a test you could remove the Engine license from the checkout routine and just check out the ArcINFO license.  If that works then it indicates the checkout process was stopping at the Engine license.  If it fails, then that indicates there is a problem checking out the ArcINFO license.
0 Kudos
BaghdadAlAlavi
New Contributor
I do not work with Engine applications anymore so I am unfamiliar with how the licensing works now.  The way that it used to work is it would try checking out the licenses you specified in the order you specified them until a checkout was successful.  At that point it would quit checking out licenses.  You are specifying the Engine license first, so perhaps it's stopping once that license is checked out.  If you have ArcGIS Desktop on the machine, then you don't need the Engine license at all so for a test you could remove the Engine license from the checkout routine and just check out the ArcINFO license.  If that works then it indicates the checkout process was stopping at the Engine license.  If it fails, then that indicates there is a problem checking out the ArcINFO license.


I removed Engine license and remained just ArcInfo License but problem still exists.
I had already installed SP5 for Engine.
Anyone has ArcGIS Engine 10.1 or 10.2 to test this code? Maybe it has solved in upper versions.
This my simplified code:

   Dim GP As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor
        Dim EliminateTool As New ESRI.ArcGIS.DataManagementTools.Eliminate
        EliminateTool.in_features = "D:\input.shp"
        EliminateTool.out_feature_class = "D:\output.shp"

        Dim pGPResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
        GP.OverwriteOutput = True
        pGPResult = GP.Execute(EliminateTool, Nothing)


Thanks in advance for your helps
0 Kudos
NeilClemmons
Regular Contributor III
If you removed the Engine license checkout and it still doesn't work then that indicates a problem with your ArcINFO license.  What version of ArcGIS are you programming against?  What version of ArcMap is installed on the machine you're running this code on?  When you put a breakpoint in your license checkout code and step through it with the debugger, what result is returned from the license checkout call?  Are you testing on the same machine you're using for development or do you have a separate test machine?
0 Kudos
BaghdadAlAlavi
New Contributor
Thanks Neil
I copied my code for running eliminate tool to another new application and now, it runs properly with ArcInfo license checked. (Although there is still some errors but they are about inputs of geoprocessing tool and not license). So, I can confirm that eliminate tool runs with ArcInfo license.
But, now one more problem has risen.  In my original application, If I change Engine Lincese to ArcInfo license, I cannot access to engine controls; I.e.  I cannot add data to MapControl or use PageLayoutControl. There is no problem with ArcView or ArcEditor license but these licenses are insufficient for running eliminate tool.
I've been reading different documents about licensing these days. As stated here:
There is no ArcGIS Engine Runtime equivalent to ArcInfo. Functionality that is only available with an ArcInfo license is not available in ArcGIS Engine.

But here, there are other statements which makes me confused:
an application that can run with an ArcGIS Engine license also runs with an ArcView, ArcEditor, and ArcInfo license

Also, in second link in example C, it proposes using ArcGIS Engine Runtime license or ArcInfo license, instead.
Concluding All those mesioned above, I come to this main question: Can I run my Engine Application (which includes some Engine controls) with ArcInfo License?

I have ArcGIS Desktop And Engine 10 in my computer. I can confirm that ArcInfo license is available, both by looking at ArcGIS Administrator and by running Eliminate tool in ArcGIS Desktop.
This is my first licensing code in ApplicationEvents.vb that I have changed it in many ways but no help.:

Dim EngineAvailable As Boolean = RuntimeManager.Bind(ProductCode.Engine)
            Dim DesktopAvailable As Boolean = RuntimeManager.Bind(ProductCode.Desktop)

            Dim licenseStatus As esriLicenseStatus = esriLicenseStatus.esriLicenseUnavailable
            Dim m_AoInitialize As IAoInitialize = New AoInitializeClass()
            ' Get a spatial analyst license
            If False Then
                licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine)
                licenseStatus = m_AoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst)
                licenseStatus = m_AoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst)
            ElseIf DesktopAvailable Then
                licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo)
                licenseStatus = m_AoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst)
            End If
0 Kudos
AhmedEl-Sisi
Occasional Contributor III
Also, in second link in example C, it proposes using ArcGIS Engine Runtime license or ArcInfo license, instead.
Concluding All those mesioned above, I come to this main question: Can I run my Engine Application (which includes some Engine controls) with ArcInfo License?

Yes you can.
One of the advantages of the ArcGIS Engine licensing model is that custom ArcGIS Engine applications can be deployed to users with ArcGIS Desktop installed and the ArcGIS Engine application can leverage the existing ArcGIS Desktop license to run the ArcGIS Engine application.
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000m9q000000
0 Kudos
NeilClemmons
Regular Contributor III
What the document is saying is that there is no Engine equivalent to an ArcINFO license.  Therefore, if you want to use functionality in your application that requires an INFO license then you MUST check out an ArcGIS Desktop ArcINFO license as there is no ArcGIS Engine license that will be sufficient.  In your code, you are binding to the Engine product:

Dim EngineAvailable As Boolean = RuntimeManager.Bind(ProductCode.Engine)

Since your code requires an INFO license and there is no Engine equivalent to that license level, I would imagine you need to bind to the Desktop product.  Your application will require the user to have an INFO licensed installation of ArcGIS Desktop installed in order to run your application.  They will not need any Engine product or license.
0 Kudos