How to inserting auto balloons into a drawing (with API).

To set detailing properties:

  1.   Click Options on the Standard toolbar, or click Tools, Options
  2. On the Document Properties tab, click Detailing.

  3. Select from the options described below, then click OK

I hope with API,  inserting auto balloons into a drawing.

*****************************************************************

https://forum.solidworks.com/message/142919#142919 is code

Dim swApp As Object

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

Sub Main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

Dim myNote As Object

Dim myAnnotation As Object

Dim myTextFormat As Object

Set myNote = Part.InsertNote("This is rule 1" + Chr(13) + Chr(10) + "this is rule2" + Chr(13) + Chr(10) + "align to center")

If Not myNote Is Nothing Then

   myNote.Angle = 0

   boolstatus = myNote.SetBalloon(swBS_Triangle, swBF_2Chars)

   Set myAnnotation = myNote.GetAnnotation()

   If Not myAnnotation Is Nothing Then

      longstatus = myAnnotation.SetLeader2(False, 0, True, False, False, False)

      boolstatus = myAnnotation.SetPosition(0.1, 0.1, 0)

      Set myTextFormat = Part.GetUserPreferenceTextFormat(0)

      myNote.SetTextJustification (swTextJustificationCenter)

      myTextFormat.Italic = False

      myTextFormat.Underline = False

      myTextFormat.Strikeout = False

      myTextFormat.Bold = False

      myTextFormat.Escapement = 0

      myTextFormat.LineSpacing = 0.001

      myTextFormat.CharHeight = 0.002

      myTextFormat.TypeFaceName = "Helvetica Narrow"

      myTextFormat.WidthFactor = 1

      myTextFormat.ObliqueAngle = 0

      myTextFormat.LineLength = 0

      myTextFormat.Vertical = False

      myTextFormat.BackWards = False

      myTextFormat.UpsideDown = False

      myTextFormat.CharSpacingFactor = 1

      boolstatus = myAnnotation.SetTextFormat(0, False, myTextFormat)

   End If

End If

Part.ClearSelection2 True

Part.WindowRedraw

End Sub

SolidworksApi macros