这是VBA帮助里的,我改了一下,你自已看吧 Sub Example_AddLeader() ' This example creates a leader in model space. ' The leader is not attached to any annotation object ' in this example. Dim leaderObj As AcadLeader Dim points(0 To 8) As Double Dim leaderType As Integer Dim annotationObject As AcadObject Dim insertpt(2) As Double insertpt(0) = 15: insertpt(1) = 20: insertpt(2) = 0 Set annotationObject = ThisDrawing.ModelSpace.AddMText(insertpt, 30, "例子") annotationObject.Height = 6 points(0) = 0: points(1) = 0: points(2) = 0 points(3) = 10: points(4) = 10: points(5) = 0 points(6) = 20: points(7) = 10: points(8) = 0 leaderType = acLineWithArrow 'Set annotationObject = Nothing ' Create the leader object in model space Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType) ZoomAll End Sub |