導線型尺寸標注用來添加旁注、說明文字,創建導線型型標注對象用AddLeader方法,語法格式如下。
RelVal=object.AddLeader(PointsArray,Annotation,Type)
下面的程序創建并顯示一個有箭頭的導線型標注。
Private Sub Command1_Click()
Dim leaderobj As AcadLeader
Dim points(0 To 8) As Double
Dim leadertype As Integer
Dim annotationobject As AcadObject
Dim mtextobj As AcadMText
Dim corner(0 To 2) As Double
Dim width As Double
Dim text As String
corner(0) = 0#: corner(1) = 15#: corner(2) = 0#
width = 30
text = "R1.5(min)"
Set mtextobj = acadapp.ActiveDocument.ModelSpace.AddMText(corner, width, text)
Set annotationobject = mtextobj
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 4: points(4) = 4: points(5) = 0
points(6) = 4: points(7) = 5: points(8) = 0
leadertype = acLineWidthArrow
Set leaderobj = acadapp.ActiveDocument.ModelSpace.AddLeader(points, annotaionobject, leadertype)
ZoomExtents
End Sub