Calculate field not working

428
2
Jump to solution
03-01-2023 02:38 AM
Daniel4
New Contributor II

Hi everybody

I am trying to make an add-in, that make some geoprocceing steps to a layer in toc:

1. Copy the layer

2. FeatureVerticesToPoints (if its a polygon or line)

3. Calculategeometry to get Z value

4. Calculate Field (to round up the calculation from the z value)

 

The last step is not working for me. 

I am using this snippt:

 

 

var argsCalculateField =  Geoprocessing.MakeValueArray(outfc, "zValue", "round($feature.zValue,2)", "ARCADE");
                                                 
IGPResult resultCalculateField = await Geoprocessing.ExecuteToolAsync("managment.CalculateField", argsCalculateField);

if (resultCalculateField.IsFailed)
{                              Geoprocessing.ShowMessageBox(resultCalculateField.Messages, "Content Header", GPMessageBoxStyle.Error);

}

 

 

 In AGP it shows an error message, but whitout content:

Daniel4_0-1677666864350.png

In AGO I would to something like this:

Daniel4_1-1677667013165.png

 

 

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

I think you have misspelling in your calculator tool name. In your code

managment.CalculateField

 must be

management.CalculateField

View solution in original post

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I think you have misspelling in your calculator tool name. In your code

managment.CalculateField

 must be

management.CalculateField
0 Kudos
Daniel4
New Contributor II

OMG!

What a stupid mistake.

 

Thanks 🙂 

0 Kudos