下面的程序读取当前图纸的每一个note,并在debug中打印结果。
Option ExplicitDim swname As String
Dim swtext As String
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swNote As SldWorks.note
Dim swAnn As SldWorks.Annotation
Dim bRet As Boolean
Debug.Print "begin:" & Chr(10)
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
Set swDraw = swModel