I am creating a new layer and I would like for the new layer to take on the fields schema from the input layer. How can I accomplish this in ArcGIS Pro SDK C#?

This is the code that I have to retrieve the fields for the inRoutes. How do I apply these fields to the newly created feature class?

var fields = inRoutes.GetFeatureClass().GetDefinition().GetFields();
var newfc = await Geoprocessing.ExecuteToolAsync("CreateFeatureclass_management", Geoprocessing.MakeValueArray(fcPath, filename, "POLYLINE", "", "ENABLED", "DISABLED", sr), null, null, null, GPExecuteToolFlags.AddOutputsToMap);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.