laptop and a wrench

不具合

ICalculator or ICalculatorUI2 do not offer a property where the parser (expression type) can be specified; VBScript is the default, so Python expressions error out.

最後に公開された状態: August 31, 2014 ArcGIS for Desktop
不具合 ID 番号 NIM061356
送信されましたSeptember 21, 2010
最終更新日June 5, 2024
適用対象ArcGIS for Desktop
見つかったバージョン10.0
プログラム言語VBA
オペレーティング システムWindows OS
オペレーティング システムのバージョン7 64 Bit
ステータスWill Not Be Addressed

参考情報

We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.

対処法

Below is a workaround that compensates for the lack of being able to specify the parser in ICalculator. It takes advantage of IGeoProcessor and the CalculateField_management geoprocessing tool. The parser or expression_type argument of that tool can be used to specify Python as the parser.'(To test the below VBA code, create a UIButton in VBA and add the code inside the Click event handler of your new UIButton. The second procedure, ReturnMessages(), is called into action by the first procedure towards the very end, but may not be necessary if you do not want to read the messages of the geoprocessing results. Change the first parameter as needed to reflect the correct location of your input table.)Private Sub UIButtonControl1_Click() 'Create the Geoprocessor Dim pGp As IGeoProcessor Set pGp = New GeoProcessor 'Set Overwriteoutput to True pGp.OverwriteOutput = True 'Add the custom toolbox containing the model tool 'pGp.AddToolbox "C:\CustomTools\custom.tbx" 'Create the Parameter array Dim pParamArray As IVariantArray Set pParamArray = New VarArray 'Populate array of parameters 'First Parameter: in_table (e.g. File GDB feature class) pParamArray.Add "C:\Incidents\845875\Converted_GDB931\downgradedFGDB.gdb\Main_931" 'Second Parameter: field on which to calculate pParamArray.Add "LastField" 'Third Parameter: expression pParamArray.Add "math.log1p(!SumOfConcentrations!)" 'Fourth Parameter: expression_type (Optional) !!! !!! !!! !!! !!! pParamArray.Add "PYTHON_9.3" Dim pResult As IGeoProcessorResult 'Execute the Model tool Set pResult = pGp.Execute("CalculateField_management", pParamArray, Nothing) 'Get the returned tool messages ReturnMessages pResultEnd SubPublic Sub ReturnMessages(ByVal messages As IGeoProcessorResult) Dim i As Long Dim message As String For i = 0 To messages.MessageCount - 1 message = messages.GetMessage(i) Debug.Print message NextEnd Sub

再現の手順

不具合 ID: NIM061356

ソフトウェア:

  • ArcGIS for Desktop

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動