2 Replies Latest reply on Dec 2, 2014 11:02 PM by Lucas Gingery

    How To Change Arrow Style On Balloons

    Lucas Gingery

      I have found the macro shown below that edits the balloon notes.  How would I make this also modify all of the annotation balloons to have a leader arrow with no arrow head, just a straight line?  I have found thaty there are different arrow head styles : 2012 SolidWorks API Help - swArrowStyle_e Enumeration  and I would assume I am looking for swNO_ARROWHEAD.  How to I add this to the macro below?


      Dim swApp As SldWorks.SldWorks

      Dim swDraw As SldWorks.DrawingDoc

      Sub main()


          Set swApp = Application.SldWorks

          Set swDraw = swApp.ActiveDoc

          Dim swView As SldWorks.View

          Set swView = swDraw.GetFirstView


          While Not swView Is Nothing


              Dim vAnnots As Variant

              vAnnots = swView.GetAnnotations

              Dim i As Integer


              If Not IsEmpty(vAnnots) Then

                  For i = 0 To UBound(vAnnots)

                      Dim swAnn As SldWorks.Annotation

                      Set swAnn = vAnnots(i)

                      If swAnn.GetType = swAnnotationType_e.swNote Then

                          Dim swNote As SldWorks.Note

                          Set swNote = swAnn.GetSpecificAnnotation

                          If swNote.IsBomBalloon() Then

                              swNote.SetBalloon swBalloonStyle_e.swBS_SplitCirc, swBalloonFit_e.swBF_2Chars

                              swAnn.SetLeader3 swLeaderStyle_e.swSTRAIGHT, swLeaderSide_e.swLS_SMART, False, False, False, False


                          End If

                      End If


              End If

              Set swView = swView.GetNextView



      End Sub