【求助】多段线图形生成后实现外轮廓的选择标注
本人在工作中学习改进一点VBA代码,画图多段线图形后,能否选择生成的图形,实现多段线的标注类似论坛高手zzyong00的实现效果,'使用点数组创建轻量多段线Public Function AddLWPline(ByRef pt() As Double, ByVal width As Double) As AcadLWPolyline
Dim objPline As AcadLWPolyline
'错误处理
If (UBound(pt) + 1) Mod 2 <> 0 Then
MsgBox "数组元素个数必须为偶数!"
Exit Function
End If
Set objPline = ThisDrawing.ModelSpace.AddLightWeightPolyline(pt)
objPline.ConstantWidth = width
objPline.Update
Set AddLWPline = objPline
End Function
'多短线类型1
Public Sub Polyline()
Dim ptArr1(0 To 9) As Double
Dim objLWPlineAs AcadLWPolyline
'多段线定点坐标数组
ptArr1(0) = 0: ptArr1(1) = 0
ptArr1(2) = 60: ptArr1(3) = 0
ptArr1(4) = 60: ptArr1(5) = 40
ptArr1(6) = 0: ptArr1(7) = 60
ptArr1(8) = 0: ptArr1(9) = 0
Set objLWPline = AddLWPline(ptArr1, 0)
'设置多段线的凸出参数,1为半圆,0表示直线
objLWPline.SetBulge 1, 0.414
objLWPline.Update
End Sub如果能实现选择后标注,标注的样式能否一起定义?
图形代码已经附上,实现效果就是图形生成后,选择图形,能够生成图片对应的选择后及出现标注的效果。
页:
[1]