The BranchVersion.CreateAsync method creates a web feature layer branch version for the specified web feature layer.
Declaration
public async Task<string> Esri.ArcGISForAutoCAD.BranchVersion.CreateAsync(Document doc, string flName, string branchName, string access, string description = "")
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | flName | An existing web feature layer name in the drawing that supports branch versioning. | required |
string | branchName | A name to be used for the new branch version. | required |
string | access | The access level of the branch version. Options are "Public", "Private", and "Protected". | required |
string | description | Description text provided by the creator of the branch version (up to 64 characters). | optional |
Returns
| Type | Description |
|---|---|
string | The name of the new branch version, which will be prefixed with the username of the user who created the branch. |
Remarks on error conditions
This method may throw an exception or return an empty string or null if a parameter is invalid or the web feature layer does not support branch versioning.
Example
Create a branch version named phase1 for the Distribution web feature layer and print the new branch version name.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var flName = "Distribution";
// Create the branch
var newBranchName = await Esri.ArcGISForAutoCAD.BranchVersion.CreateAsync(doc, flName, "phase1", "Public", "Proposed Changes");
// Print the new branch name
doc.Editor.WriteMessage(newBranchName);
/* Example output
editor01.phase1
*/
See also
WebFeatureLayer.Get—A .NET method that gets the web feature layer properties for the specified web feature layer as a dictionary.
esri_webfeaturelayer_createBranch—An AutoLISP function that creates a web feature layer branch version for the specified web feature layer.