2 Replies Latest reply on Dec 19, 2016 11:54 AM by Wayne Schafer

    Macro for inserting Split Balloon

    Wayne Schafer


      Does anyone have a macro for inserting a split balloon in SW2016?

        • Re: Macro for inserting Split Balloon
          Simon Turner

          This will insert a split balloon with "A" on the top, and "23" on the bottom. You'll need to change the SelectByID2 to actually select what you want to balloon:

           

           

          Dim swApp As SldWorks.SldWorks

          Dim Part As ModelDoc2

          Dim boolstatus As Boolean

          Dim longstatus As Long, longwarnings As Long

           

          Sub main()

              Dim myNote As Note

              Dim BomBalloonParams As BalloonOptions

           

              Set swApp = Application.SldWorks

              Set Part = swApp.ActiveDoc

             

              boolstatus = Part.Extension.SelectByID2("Line3", "SKETCHSEGMENT", 0.272729922359744, 0.19285376344086, 0, False, 0, Nothing, 0)

              Set BomBalloonParams = Part.Extension.CreateBalloonOptions()

              BomBalloonParams.Style = 7

              BomBalloonParams.Size = 2

              Set myNote = Part.Extension.InsertBomBalloon2(BomBalloonParams)

              myNote.SetBomBalloonText 1, "A", 1, "23"

          End Sub