Get Upper-right Text Coordinates of Selected Note Example (VBA)
This example shows how to get the coordinates for the upper-right text
point in the selected note.
'----------------------------------------
'
' Preconditions: Model document is open and a note is
selected.
'
' Postconditions: None
'
'-----------------------------------------
Option Explicit
Sub main()
Dim
swApp As
SldWorks.SldWorks
Dim
swModel As
SldWorks.ModelDoc2
Dim
swSelMgr As
SldWorks.SelectionMgr
Dim
swNote As
SldWorks.Note
Dim
vpoints As
Variant
Dim
i As
Long
Set
swApp = CreateObject("SldWorks.Application")
Set
swModel = swApp.ActiveDoc
Set
swSelMgr = swModel.SelectionManager
Set
swNote = swSelMgr.GetSelectedObject6(1,
0)
Debug.Print
swNote.GetName
vpoints
= swNote.GetUpperRight
For
i = 0 To UBound(vpoints)
Debug.Print
vpoints(i)
Next
i
End Sub