Skip To Content

WebFeatureLayer. SynchronizeAsync (.NET)

The WebFeatureLayer.SynchronizeAsync method allows you to programmatically synchronize changes. This method will post updated changes on the specified web feature layer. Once changes are posted, the layer will be redrawn to include all changes within the current project area.

The process of synchronizing a feature layer will update the feature layer source with geometric and attribute edits made in the drawing. All of the feature entities on the web feature layer's CAD layer will be erased, and features from the server within the project area will be added back to the drawing, including all edits from other sources.

Declaration

public async Task<bool> Esri.ArcGISForAutoCAD.WebFeatureLayer.SynchronizeAsync (Document doc, string flName)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

flName

An existing web feature layer name in the drawing.

required

Returns

TypeDescription

bool

true if the web feature layer was synchronized successfully

Remarks on error conditions

This method may throw an exception or return false or null if a parameter is invalid.

Example

Print the success of committing the edits for the Shelters web feature layer in the current drawing.

// Initialize
Document doc = Application.DocumentManager.MdiActiveDocument;

// Commit the edits
var success = await Esri.ArcGISForAutoCAD.WebFeatureLayer.SynchronizeAsync (doc, "Shelters");

// Print the success
doc.Editor.WriteMessage(success.ToString());

/* Example output
True
*/

See also

WebFeatureLayer.EditCounts—A .NET method that returns the number of pending changes to the specified web feature layer.

WebFeatureLayer.HasEdits—A .NET method that returns true if the web feature layer contains edits that have not yet been committed to the source feature service.

esri_webfeaturelayer_commit—An AutoLISP function that posts updated changes on the specified web feature layer.