I am trying to run CalculateGeometryAttributes_management, but I can not figure out what data type to use for the
Dictionary<string,string> items = new Dictionary<string, string> { "Area", "AREA" };
arguments1 = Geoprocessing.MakeValueArray(floodShape, items, "FEET_US", "SQUARE_FEET_US");
gpResult1 = Geoprocessing.ExecuteToolAsync("CalculateGeometryAttributes_management", arguments1, enviroment, null, null, GPExecuteToolFlags.None);
Anyone know what data type to use?
It is recommended that a user always check the tool's documentation page to make sure the data type of each parameter. For example the doc for the tool is here - you can jump to this page by clicking on the help button (? mark).
https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-geometry-attributes.htm
There you'll find the syntax:
CalculateGeometryAttributes_management (in_features, geometry_property, {length_unit}, {area_unit}, {coordinate_system})
Below the syntax, you'll see data type of each parameter, with explanation and valid values.
As I said in my original question, the data type listed in the documentation is value table. My question is what data type in C# corresponds to data table. I have tried KeyValuePair, array of KeyValuePairs, lists of KeyValuePairs, and dictionaries. None of these will work.
Okay, I got it now. Here is the code that runs successfully for me:
var fields = "AAA TEXT 'A A A' 255 # #;BBB LONG 'B B B' # # #;CCC DOUBLE 'C C C' # # #";
# within double quote: field_name, field_type, field_alias, field_lenght (for string)
# for multiple fields (AddFields tool), separate two fields by semicolon
I got this syntax by running the tool via tool dialog and then drag-dropping the result from History tab to Python window.