AnsweredAssumed Answered

modifying some values in an active template

Question asked by sergueisokolov on Jan 5, 2019
Latest reply on Jan 13, 2019 by sergueisokolov

I’ll need to Create a feature using the current template while modifying some values in an active template (i.e. setting a common note or specific Asset ID value "before" creating a feature with the template, other default values in the template are Ok). I want to avoid two-steps process - create a feature with the template and then modify it in second Edit operation.

var myTemplate = ArcGIS.Desktop.Editing.Templates.EditingTemplate.Current;

var myGeometry = _geometry;

var op = new ArcGIS.Desktop.Editing.EditOperation();

op.Name = "Create my feature";
// NEED TO UPDATE some of myTemplate default attributes here

op.Create(myTemplate, myGeometry); op.Execute();


When creating a feature in ArcGIS Pro, one can open an active template pane to modify default values for features to be created with this template. Can this be done via API ?

I tried to leverage myTemplate.Inspector to get the Inspector that should contain the associated template values (as per the doc) but it is set to null . I guess I do not know how to use the API in this case. Any advise, code snippets will be appreciated. Thanks