Create Compound Note Example (VBA)
This example shows how to create a compound
note in a drawing document.
'---------------------------------------------
Dim swApp As Object
Dim drawing As Object
Dim note As Object
Sub main()
Set swApp =
CreateObject ("SldWorks.Application")
Set drawing = swApp.ActiveDoc
makeCnote
End Sub
sub makeCnote()
set note = drawing.CreateCompoundNote
(0.00635, 0.05, 0.2, 0.0)
note.AddText
"zero pt", 0, 0, 0
note.AddText
"top", 0.01, 0.01, 0
note.BeginSketchEdit
drawing.CreateLineVB
0, 0, 0, 0.01, 0.01, 0
drawing.CreateCircleVB
0, 0, 0, 0.01414
note.EndSketchEdit
If (note.IsCompoundNote())
Then
count = note.GetTextCount()
n2 = note.GetTextAtIndex (2)
n1 = note.GetTextAtIndex (1)
ht2 = note.GetHeightAtIndex (2)
End if
End Sub