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)
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.
'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
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.
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)
There is no ArcGIS Engine Runtime equivalent to ArcInfo. Functionality that is only available with an ArcInfo license is not available in ArcGIS Engine.
an application that can run with an ArcGIS Engine license also runs with an ArcView, ArcEditor, and ArcInfo license
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
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?