ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Code example: VST with duplicate array values removed

The LabelStatus_Code field, with a coded value domain, is used to store the abbreviation option chosen for each annotation feature. The field containing the annotation text string, such as Label_Txt, must have a data type of Text with a length of at least 2,000 characters.

This code example shows the duplicate array values removed in case you are exceeding the 2,000-character limit for the Label_Txt field.

Function Generate([OBJECTID], [OBJECTID_arr], [LABELSTATUS_CODE], [LABELSTATUS_CODE_arr], [PRIMARYNAVAID_CODE], [PRIMARYNAVAID_CODE_arr], [SystemSubtype], [SystemSubtype_arr], [Ident_Txt], [Ident_Txt_arr], [Frequency_Val], [Frequency_Val_arr], [Channel_Txt], [Channel_Txt_arr], [Voice_Code], [Voice_Code_arr], [ComponentSubtype], [ComponentSubtype_arr], [Name_Txt], [Name_Txt_arr], [LAT_TXT], [LAT_TXT_arr], [LONG_TXT], [LONG_TXT_arr], [ROLEFIX_CODE], [ROLEFIX_CODE_arr])

VariableArray = Array([LABELSTATUS_CODE_arr], [PRIMARYNAVAID_CODE_arr], [SystemSubtype_arr], [Ident_Txt_arr],
[Frequency_Val_arr],[Channel_Txt_arr], [Voice_Code_arr], [ComponentSubtype_arr], [Name_Txt_arr], [LAT_TXT_arr],
[LONG_TXT_arr], [ROLEFIX_CODE_arr])
k = 0
'Number of arrays 
lVariableCount = UBound(VariableArray) + 1

'Number of records in each array 
firstArray = VariableArray(0)
lRecordsCount = UBound(firstArray ) + 1

do while k < lRecordsCount 
         strOutput = firstArray(k) 
         i = 1 
         do while i < lVariableCount 
                  strOutput = strOutput & "<>"
                  tempArray = VariableArray(i) 
                  strOutput = strOutput & tempArray(k) 
                  i = i + 1 
         loop

'If we already have a string with the same record combination then don't add 
'it again 
if (inStr(strUniqueRecords, strOutput) <> 0) then 
         'Do Nothing 
else 
         'Add this to record array 
         if k > 0 then
                  strRecordsToInclude = strRecordsToInclude & "," & k
                  strUniqueRecords = strUniqueRecords & strOutput & "||" 
         else
                  strRecordsToInclude = k 
                  strUniqueRecords = strOutput & "||" 
         end if 
end if 
k = k + 1 
loop

RecordsToIncludeArray = Split(strRecordsToInclude, ",") 
k = 0
i = 0 
do while k < UBound(VariableArray) + 1 
         tempArray = VariableArray(k) 
         i = 1 
         strOutputText = strOutputText & tempArray(0) 
         do while i < ubound(RecordsToIncludeArray) + 1

                  strOutputText = strOutputText & "<>" 
                  recordId = RecordsToIncludeArray(i) 
                  strOutputText = strOutputText & tempArray(recordId) 
                  i = i + 1 
loop 
 strOutputText = strOutputText & "||" 
    k = k + 1 
loop 

Generate = strOutputText 
End Function

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2022 Esri. | 隐私政策 | 法律声明