Select to view content in your preferred language

Program crashes during Calculate Field

797
3
01-22-2013 09:17 AM
StanStas
Deactivated User
Hello,

I've made up my first custom install. After installation it crashes during geoprocessing function Calculate Field with this return message:

Executing: CalculateField lyr value 10 VB #
Start Time: Tue Jan 22 17:22:16 2013
General error executing calculator.
ERROR 999999: Error executing function.
The operation could not be completed because the script engine has not been initialized to a valid language.
Failed to execute (CalculateField).
Failed at Tue Jan 22 17:22:16 2013 (Elapsed Time: 0,00 seconds)

I use VB.NET, Visual Studio 2010, W7, ArcGIS 10.1... What did I miss? Any ideas?

Thanks for response!
0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor
You need to upload your code if you want anyone to even have a chance at answer this!
0 Kudos
StanStas
Deactivated User
I don't think that problem is in syntax in the Calculate Field operation, because my program works in the ArcGIS 10.0 without that error. Is it possible that problem cause newer version of the ArcGIS 10.1? Or maybe I did something wrong in setting in the Visual Studio Setup.

   Dim makefeaturelayerobjekt As ESRI.ArcGIS.DataManagementTools.MakeFeatureLayer = New ESRI.ArcGIS.DataManagementTools.MakeFeatureLayer(copyfeatureobjekt_output, "lyr")
   Geoprocessing(makefeaturelayerobjekt)

   value = 10

   Dim addfieldobjekt As ESRI.ArcGIS.DataManagementTools.AddField = New ESRI.ArcGIS.DataManagementTools.AddField("lyr", "value", "Long")
   Geoprocessing(addfieldobjekt)

   Dim calculatefieldobjekt As ESRI.ArcGIS.DataManagementTools.CalculateField = New ESRI.ArcGIS.DataManagementTools.CalculateField("lyr", "value", value)
   Geoprocessing(calculatefieldobjekt)


    Private Sub Geoprocessing(ByVal objekt As Object)

        Try
            resultsGP = CType(gp.Execute(objekt, Nothing), IGeoProcessorResult)
            txtMessages.Text &= objekt.ToolName() & " > "
            gp.ClearMessages()
        Catch ex As Exception
            For Count As Integer = 0 To gp.MessageCount - 1
                txtMessages.Text &= (gp.GetMessage(Count) & Constants.vbCrLf)
            Next Count
            gp.ClearMessages()
            Throw
        End Try

    End Sub
0 Kudos
DuncanHornby
MVP Notable Contributor
OK this is a shot in the dark. I don't tend to call geo-processing tools the way you are, I use the old style create a variant array and pass that to a tool. I just have not got around to learning your method. But I'm guessing you are missing a parameter? Your error message talks about a scripting engine, so I'm guessing you have to explicitly state which one you are using VBScript or Python? But I don't know how you would do that with your approach.

Duncan
0 Kudos