You know that ArcMap provides a flexible tagging method. Apart from common tagging, it also supports VBScript and JScript, and AE also provides corresponding functions.
For example, ArcMap expression (VBScript ):
Function findlabel ([st_name], [suffix])
If ([suffix] = "hwy") then
Findlabel = [st_name]
End if
End Function
In AE,
// Global variables
Private iannotatelayerpropertiescollection pannoprops;
Private ilabelenginelayerproperties plabelengine;
Ibasicoverposterlayerproperties4 pbasic;
// Set on layer selection
Pannoprops = pgeolayer. annotationproperties;
// Label creation Function
Pbasic = new basicoverposterlayerpropertiesclass ();
Pbasic. featuretype = esribasicoverposterfeaturetype. esrioverposterpolyline;
Pbasic. linelabelplacementpriorities = lineplacement;
Pbasic. linelabelposition = lineposition;
Plabelengine = new labelenginelayerpropertiesclass ();
Plabelengine. basicoverposterlayerproperties = (ibasicoverposterlayerproperties) pbasic;
Plabelengine. isexpressionsimple = false;
Iannotationexpressionengine extends Peng = new annotationvbscriptengineclass ();
Plabelengine. expressionparser = paipeng;
Plabelengine. expression = "function findlabel (" + fieldlb. selecteditem + "," + fieldcb. text + ") \ n if (" + fieldcb. text + "" + equalitybtn. text + "\" "+ criteriatxt. text + "\") Then \ n findlabel = "+ fieldlb. selecteditem + "\ n end if \ n end function"; plabelengine. symbol = mytxtsym;
Pannolayerprops = (iannotatelayerproperties) plabelengine;
Pannolayerprops. Class = fieldlb. selecteditem. tostring ();
Pannoprops. Add (pannolayerprops );
It can be seen that the expression can only be used to directly convert VBScript into a string. Note that you need to press enter to maintain the format.
From: http://hi.baidu.com/xduoo/blog/item/13aa0636fc6450c7a2cc2bed.html