ARCGIS PRO SDK VB2022 创建Annotation要素类

完整代码:

Dim PWKID As Integer
dim zyzwx as Double
'创建空间参考
PWKID = 4513 - 25 + Val(zyzwx) / 3
Dim RF1 As ArcGIS.Core.Geometry.SpatialReference = SpatialReferenceBuilder.CreateSpatialReference(PWKID)
Dim shapeDescription As ShapeDescription = New ShapeDescription(GeometryType.Polygon, RF1)
'获取默认地理数据库
Dim gdbPath As String = Project.Current.DefaultGeodatabasePath
'创建要素类
Await QueuedTask.Run(Sub()
                     Dim globalIDFieldDescription As FieldDescription = 
                     FieldDescription.CreateGlobalIDField()
                     Dim FieldDescription1 As FieldDescription = 
                     FieldDescription.CreateStringField("备注", 50)
                     Dim FieldDescription2 As FieldDescription = FieldDescription.CreateStringField("所属图", 50)
                     fieldDescriptions = New List(Of FieldDescription) From {globalIDFieldDescription, FieldDescription1, FieldDescription2}
                     shapeDescription = New ShapeDescription(GeometryType.Polygon, RF1)
                     Dim generalPlacementProperties As                                                                CIMMaplexGeneralPlacementProperties = New CIMMaplexGeneralPlacementProperties
                     With generalPlacementProperties                  '常规放置属性
                         .AllowBorderOverlap = True                    '允许边框重叠
                         .PlacementQuality = MaplexQualityType.High    '精准放置
                         .DrawUnplacedLabels = True
                         .InvertedLabelTolerance = 1.0                 '容差
                         .RotateLabelWithDisplay = True                '随显示旋转标签
                     End With
                     Dim blueLabelClass As CIMLabelClass = New CIMLabelClass
                     With blueLabelClass
                         .Name = "Blue"
                         .ExpressionTitle = "Expression-Blue"
                         .ExpressionEngine = LabelExpressionEngine.Arcade
                         .Expression = "$feature.OBJECTID"
                         .ID = 1
                         .Priority = 0
                         .Visibility = True
                         .TextSymbol = New CIMSymbolReference
                         With .TextSymbol
                             .Symbol = New CIMTextSymbol()
                         End With
                     End With

                     Dim labelClasses As List(Of CIMLabelClass) = New List(Of CIMLabelClass) From {blueLabelClass}
                     Dim AnnotationFeatureClassDescription As AnnotationFeatureClassDescription = New AnnotationFeatureClassDescription(lva(0),                      fieldDescriptions, shapeDescription, generalPlacementProperties, labelClasses)
                     AnnotationFeatureClassDescription.ReferenceScale = 5000
                     SchemaBuilder.Create(AnnotationFeatureClassDescription)
                     Dim success As Boolean = SchemaBuilder.Build()
                 End Sub)

txtSymbol:

Angel    文本符号的放置角度
BlockProgression    多行文本的堆叠方向
Callout    引线
DrawSoftHyphen    连字符
FlipAngle    文本翻转(镜像)到位的角度
FontEffects    上下标
FontEncoding    获取文字的Encoding
FontFamilyName    字体名称
FontStyleName    字形样式,例如粗体、斜体。
FontType    字体样式,如宋体。
HaloSize    描边大小
HaloSymbol    描边符号
Height    文本高度
HorizontalAlignment    文本与几何体水平对齐的对齐类型
VerticalAlignment    文本与几何体垂直对齐的对齐类型
IndentAfter    后缩进
IndentBefore    前缩进
IndentFirstLine    首行缩进
LetterSpacing    字间距
LetterWidth    字宽度
LineGap    行间距
LineGapType    行间距类型
OffsetX    X轴偏移
OffsetY    Y轴偏移
ShadowColor    阴影颜色
ShadowOffsetX    阴影X轴偏移
ShadowOffsetY    阴影Y轴偏移
SmallCaps    字母大小写
Strikethrough    删除线
Symbol    文字符号
TextDirection    文字方向
Underline    下划线
WordSpacing    单词间距

  • 9
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值