<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150893#M3906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree I think this object and it's interface is broken. I tried to get it working in VBA and it was having none of it. My only suggestion is to use the GeoProcessing tool Calculate Field if you want to be able to alter the expression on the fly? I assume you want to do it that way as you are calling up the UI?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2014 13:04:05 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2014-06-24T13:04:05Z</dc:date>
    <item>
      <title>GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150892#M3905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an addin that has been ported from ArcMap 9.3 to 10.1 and this code worked perfectly in 9.3 but for some reason won't work at all in 10.1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
ICalculatorUI calc = new CalculatorUI();
calc.Table = MyTable;
calc.Field = "MyField";
calc.DoModal(ArcMap.Application.hWnd);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;The actual code is a little more complicated than that, but I've tried it with this simplified version and it still doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What happens is the calculator dialog pops up just fine and I can enter a value to set the field to, but when I hit the OK button, the dialog closes without error, but nothing has been updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've opened the table that I'm editing using ArcMap's regular ui and launched the Field Calculator on the same field and can confirm that it looks exactly like what I see when I use this bit of code on my own form. There are only three differences:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt; Prior to the dialog displaying, there's a warning dialog that pops up telling me that I'm not in an editing session and the changes can't be undone.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; After the OK button is pressed, a progress dialog shows briefly while the rows are being updated.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; The rows are actually updated.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;So everything that is displayed on the dialog itself is identical, including the name of the field and the list of other fields in the table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcMap 9.3, the `ICalculatorUI` would take over everything as soon as `DoModal` was called. It annoyingly didn't even provide feedback programmatically to signify if the user canceled the dialog or [if/how many] rows were updated. Very black box and it sucked, but at least it worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've not been able to find any help on this anywhere, especially not on ESRI's pathetic documentation, which appears to be copied and pasted from their 9.x documentation. I've also posted this question on StackOverflow, but haven't gotten any responses there either and it's been almost two weeks...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have people waiting on this, so any help would be greatly appreciated. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 15:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150892#M3905</guid>
      <dc:creator>RobertMaddox</dc:creator>
      <dc:date>2014-06-23T15:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150893#M3906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree I think this object and it's interface is broken. I tried to get it working in VBA and it was having none of it. My only suggestion is to use the GeoProcessing tool Calculate Field if you want to be able to alter the expression on the fly? I assume you want to do it that way as you are calling up the UI?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 13:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150893#M3906</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-06-24T13:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150894#M3907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Duncan for your reply! Glad to see that I'm not the only one having problems with it. As for your suggestion, are you talking about calling a geoprocessor (or ICalculator) from code? The problem with that is that the calculations are user provided. I could create a user interface that would allow the user to specify the calculations to use, but then I would have to deal with validation issues and the like, which I would really like to avoid since it would likely drive this already overdue migration project out of scope and over budget. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another issue I found when trying to use the ICalculator interface was that there's no way to cause it to only update the selected records because you have to provide an ICursor, which means I could use an IQueryFilter to filter it out, but an ISelectionSet doesn't really translate into a query very well since it only has the OIDs of the selected records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your reply. I'd appreciate any other thoughts you might have. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 13:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150894#M3907</guid>
      <dc:creator>RobertMaddox</dc:creator>
      <dc:date>2014-06-24T13:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150895#M3908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your problem got me thinking about how to open up a GeoProcessing tool and see its UI. I worked out the following code this is a viable alternative, written in VBA but I'm sure you can edit it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub OpenCalculateTool()


&lt;SPAN style="color:#006400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Hook into Toolbox and get the tool&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pUID As New UID
&amp;nbsp;&amp;nbsp;&amp;nbsp; pUID = "esriGeoprocessingUI.ArcToolboxExtension"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pArcToolboxExtension As IArcToolboxExtension
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pArcToolboxExtension = Application.FindExtensionByCLSID(pUID)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pArcToolbox As IArcToolbox
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pArcToolbox = pArcToolboxExtension.ArcToolbox
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGPTool As IGPTool
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPTool = pArcToolbox.GetToolbyNameString("CalculateField")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN style="color:#006400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create messages, required by Invoke method&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim msgs As IGPMessages
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set msgs = New GPMessages


&lt;SPAN style="color:#006400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get existing parameter structure&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pArray As IArray
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pArray = pGPTool.ParameterInfo
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN style="color:#006400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Declare Parameter interfaces&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGPParameter As IGPParameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGPDataType As IGPDataType
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGPParameterEdit As IGPParameterEdit
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN style="color:#006400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set the parameters of the tool&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameter = pArray.Element(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameterEdit = pGPParameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPDataType = pGPParameter.DataType
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameterEdit.Value = pGPDataType.CreateValue("a") &lt;SPAN style="color:#006400;"&gt;' Featurelayer name&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameter = pArray.Element(1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameterEdit = pGPParameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPDataType = pGPParameter.DataType
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameterEdit.Value = pGPDataType.CreateValue("xx") &lt;SPAN style="color:#006400;"&gt;' Field&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameter = pArray.Element(3)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameterEdit = pGPParameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPDataType = pGPParameter.DataType
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPParameterEdit.Value = pGPDataType.CreateValue("VB")


&lt;SPAN style="color:#006400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Open the tool&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGPToolCommandHelper As IGPToolCommandHelper2
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGPToolCommandHelper = New GPToolCommandHelper
&amp;nbsp;&amp;nbsp;&amp;nbsp; pGPToolCommandHelper.SetTool pGPTool
&amp;nbsp;&amp;nbsp;&amp;nbsp; pGPToolCommandHelper.InvokeModal 0, pArray, True, msgs
End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:07:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150895#M3908</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T08:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150896#M3909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I just looked at the Calculate Field tool in ArcMap and it does provide a decent way of entering the calculation once the table and field have been selected. However, I don't think it'll work in the flow that I need to have. The place where I was using ICalculatorUI is in a customized view of the table using a GridView and it depends on the field being locked down so that it can scan through the table when the calculation is done and update the values for that column.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the big annoyances in the original setup with ICalculatorUI was that there was no indication of whether or not anything was actually done, so even if the user canceled the dialog, it still had to walk the table comparing the values in the selected field with what was in the GridView. If I were to replace that with the Calculate Field tool, it would mean that the user could easily chose a different field (or even a different table) to change and I would have no way of knowing it. So then I would have to scan the entire table for changes on any of the fields. :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So for that reason, and others, I just don't think it'll work out to use toolbox tools to do what I need. Thanks for your suggestion and working out the code though. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 14:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150896#M3909</guid>
      <dc:creator>RobertMaddox</dc:creator>
      <dc:date>2014-06-24T14:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: GeodatabaseUI.ICalculatorUI2 no longer works in ArcMap 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150897#M3910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So for anyone interested, I am now using ICalculate to execute the expressions that were provided by the user. Of course this has several drawbacks, one of them being that if the users selects to use Python, it will fail. But there wasn't a better choice. At least I was able to figure out how to limit it to only updating the selected records (have to use ISelectionSet2.Update to get an update cursor).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just hope that ESRI doesn't just decide to secretly make it go back to the way it was at some point in the future and then the expressions get processed twice...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 20:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geodatabaseui-icalculatorui2-no-longer-works-in/m-p/150897#M3910</guid>
      <dc:creator>RobertMaddox</dc:creator>
      <dc:date>2014-07-09T20:06:57Z</dc:date>
    </item>
  </channel>
</rss>

