Type Example |
Using Programming Languages other than VBA
Sub Example_Type() ' This example creates a leader in model space. ' It then changes the type of the leader. Dim leaderObj As AcadLeader Dim points(0 To 8) As Double Dim leaderType As Integer Dim annotationObject As AcadEntity points(0) = 0: points(1) = 2: points(2) = 0 points(3) = 4: points(4) = 4: points(5) = 0 points(6) = 4: points(7) = 2: points(8) = 0 leaderType = acLineNoArrow Set annotationObject = Nothing ' Create the leader object in model space Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType) ZoomAll ' Find the current leader type leaderType = leaderObj.Type MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example" ' Change the leader type leaderObj.Type = acLineWithArrow leaderObj.Update MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example" ' Change the leader type leaderObj.Type = acSplineNoArrow leaderObj.Update MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example" ' Change the leader type leaderObj.Type = acSplineWithArrow leaderObj.Update MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example" End Sub
Comments? |