AnsweredAssumed Answered

How to create field without Geoprocessing tool ?

Question asked by tkoka3 on Oct 8, 2018
Latest reply on Oct 8, 2018 by RRuh-esristaff


We are developing tool in Arcgis Pro sdk .We have feature class and we are creates lot of fields using Geoprocessing tools like below in code. But when we use geoprocessing tool (management.AddField) and when we ctreate in order fields are very slow created. How can I solve this Geoprocessing tool (management.AddField)  slowness problem or can I ctreate fields by another way using pro sdk without Geoprocessing tool (management.AddField) ? Here are the code example (Adding two field in feature class) below:


Layer layer = MapView.Active.Map.FindLayers(nameOfShape).FirstOrDefault();

FeatureLayer featureLayer = layer as FeatureLayer;

Table table = (layer as FeatureLayer).GetTable();


int fieldLength = 15;
bool isNullable = true;
var parameters = Geoprocessing.MakeValueArray(tableName, "NAME", "TEXT", null, null,
fieldLength, "Name", isNullable ? "NULABLE" : "NON_NULLABLE");

var results = Geoprocessing.ExecuteToolAsync("management.AddField", parameters);


int fieldLength1 = 15;
var parameters1 = Geoprocessing.MakeValueArray(tableName, "IDREF", "TEXT", null, null,
fieldLength1, "Id Ref", isNullable ? "NULABLE" : "NON_NULLABLE");

var results1 = Geoprocessing.ExecuteToolAsync("management.AddField", parameters1);









Thanks for helping