Select to view content in your preferred language

Error 000824 with Eliminate tool in ArcGIS Engine

4668
10
03-22-2014 06:51 AM
BaghdadAlAlavi
Deactivated User
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
Deactivated User
Thanks a lot for your answers.
Neil, I told that this is my first code and I have made various changes to �?? Adding Dektop or EngineOrDesktop �?�.- but none of them worked.
Anyway, finally I could figure out the source of problem. A post in gis.stackexchange  was talking about a dialog that I wasn�??t aware of it. This dialog appears by right-clicking on license control and choosing properties. This dialog is the same as �??ArcGIS License Initializer�?� dialog which appears by Project menu>Add ArcGIs License Checking. But the functionality of these 2 dialogs is different, because checking licenses in one has no effect on the other one.
I saw Engine License in this dialog has checked which may have prevented my code from getting ArcInfo License.  I checked ArcInfo License in the above-mentioned dialog added following code to startup method of my application :
          
m_AOLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeArcInfo}, _
            New esriLicenseExtensionCode() {esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst, esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst})

Now, I can have both engine controls and eliminate tool working properly. But there is 2 problems (that is not a real problem, maybe  a sort of misunderstanding).
1. In the new computer which I use for programming, I have no ArcGIS Desktop installed. I have installed jus ArcEngine Runtime and ArcObjects SDK. How could it be possible? My program Works perfectly with ArcInfo License but there is no ArcGIS desktop in my computer. By looking at ArcGIS Administrator, i can confirm that only Engine License is available .
2. Sometimes, Visual studio prompts me following error: �??You are not licensed for .  Use the ArcGIS Adminstrator to view the software Availability, Change the license manager, or switch the ArcGIS software product�?�. Running the program from debug folder, I never get this error. It only appears in VS environment. Do you have any point for this?

Thanks a world and sorry for long post.
0 Kudos