Adds a Expression by specifying the name and expression string.

Namespace: Autodesk.Civil.DatabaseServices.Styles
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0

Syntax

C#
public Expression Add(
	string name,
	string description,
	string expression
)
Visual Basic
Public Function Add ( _
	name As String, _
	description As String, _
	expression As String _
) As Expression
Visual C++
public:
Expression^ Add(
	String^ name, 
	String^ description, 
	String^ expression
)

Parameters

name
Type: System..::..String
The name of Expression.
description
Type: System..::..String
The description of Expression.
expression
Type: System..::..String
The expression string of Expression.

Examples

CopyC#
1var db = HostApplicationServices.WorkingDatabase;
2var expressionColl = CivilDocument.GetCivilDocument(db).Styles.LabelStyles.ParcelLabelStyles.AreaLabelStyles.Expressions;
3var customExpression1 = expressionColl.Add("NewExpression", "SomeDescription", "{Drawing Scale Conversion}*100.0");
4var customExpression2 = expressionColl.Add("NewExpression2", "SomeDescription2", $"{customExpression1.ReferenceString}>6.0");

Exceptions

ExceptionCondition
System..::..ArgumentException Throw when the expression is not valid.

See Also