当前位置:你问我答 >  详情

【大鹏测绘】根据高程点注记修改高程点高程值

Sub SetGcdHeightByLabel()'根据高程点注记修改高程点高程值
  Dim sSet As AcadSelectionSet
  Dim dType(0 To 2) As Integer, dData(0 To 2) As Variant
  Dim objBlock As AcadBlockReference, iCount As Integer
  Dim varAttributes As Variant, pnt As Variant, i As Integer
  dType(0) = 0: dData(0) = "INSERT"
  dType(1) = 2: dData(1) = "GC200"
  dType(2) = 8: dData(2) = "GCD"
  Set sSet = ThisDrawing.Application.ActiveDocument.SelectionSets.Add("GCD")
  sSet.Select acSelectionSetAll, , , dType, dData
  If sSet.Count = 0 Then
     MsgBox "图形中未发现高程点。", vbInformation, "修改高程点高程值"
  Else
     For Each objBlock In sSet
         varAttributes = objBlock.GetAttributes
         pnt = objBlock.InsertionPoint
         pnt(2) = CDbl(varAttributes(0).TextString)
         objBlock.InsertionPoint = pnt
         i = i + 1
         ThisDrawing.Application.ActiveDocument.Utility.Prompt vbCr & vbCr & "已完成 " & i & "/" & sSet.Count & " ..."
     Next
  End If
  sSet.Delete
End Sub

全部评论

等级:LV30
积分:72050
奔跑蜗牛 2021-02-05 09:19
了解
回复 0
等级:LV25
积分:48324
啊恒15125464119 2021-02-05 10:20
点赞
回复 0
等级:LV30
积分:114517
花好月圆人寿 2021-02-05 17:00
谢谢分享
回复 0
等级:LV10
积分:100
新手01579 2022-05-13 14:02
大神,收下我的膝盖
回复 0
等级:LV10
积分:100
新手01579 2022-05-13 14:10
是LSP么?怎么执行,报函数错误
回复 0
1

提交
悬赏回复规则
1、悬赏期为24小时,从发布时间起算;
2、悬赏期内提问者如设置评论为“精选评论”,视为悬赏结束,该精选评论人将获得本题全部悬赏积分;
3、悬赏期内如提问者未设置“精选评论”,则前5位评论者平分悬赏积分(如仅有一位评论,该评论者获得50%悬赏积分);
4、悬赏积分会自动发放到生态圈账户中,请留意站内信通知。
知道了

距离打开宝箱还剩7

是否花费200积分补签?
确认
取消