Here's the relevent code:
Code: Select all
For j = 0 To UBound(swAnnotations)
If DecodeAnnotType(swAnnot.GetType) = "swNote" Then
Set swAnnot = swAnnotations(j)
Set swNote = swAnnot.GetSpecificAnnotation()
Debug.Print "Name: " & swAnnot.GetName()
Debug.Print " Type: " & swAnnot.GetType
Debug.Print " Style: " & swNote.GetBalloonStyle
Set swNote = swModelDocExt.EditBalloonProperties2(swBS_SplitCirc, swBF_5Chars, swBalloonTextCustom, "Upper", swBalloonTextCustom, "Lower", 0, True, 1, "X", 0.0355)
Debug.Print "Name: " & swAnnot.GetName()
Debug.Print " Type: " & swAnnot.GetType
Debug.Print " Style: " & swNote.GetBalloonStyle
End If
Next j
Code: Select all
Name: DetailItem1872
Type: 6
Style: 1
Name: DetailItem1872
Type: 6
I tried the example code from https://help.solidworks.com/2022/englis ... ple_vb.htm where it operates on a note (balloon) that is selected by the user and it works fine. It's as if my EditBalloonProperties2 is corrupting the balloon that was selected using GetSpecificAnnotation(). My "Set swNote" statement is copied verbatim from the SW API Help example.
Thanks for your help.