Anchor a Note Example (VB.NET)
This example shows how to anchor a note and set its text to all uppercase.
'----------------------------------------------------------------------------
' Preconditions: Open:
' install_dir\samples\tutorial\advdrawings\foodprocessor.slddrw
'
' Postconditions: The note, Drawing View1, is locked in position at the
' specified location, and its text is all uppercase.
'
' NOTE: Because the model is used elsewhere,
' do not save changes when closing it.
'
---------------------------------------------------------------------------
Imports
SolidWorks.Interop.sldworks
Imports
SolidWorks.Interop.swconst
Imports
System.Runtime.InteropServices
Imports
System
Partial
Class
SolidWorksMacro
Dim
Part As
ModelDoc2
Dim
myNote As
Note
Dim
myAnnotation As
Annotation
Dim
boolstatus As
Boolean
Sub
main()
Part = swApp.ActiveDoc
myNote = Part.InsertNote("Drawing
View1")
If
Not
myNote Is
Nothing
Then
myNote.LockPosition
= True
myNote.AllUpperCase
= True
myAnnotation = myNote.GetAnnotation()
If
Not
myAnnotation Is
Nothing
Then
boolstatus =
myAnnotation.SetPosition(0.2, 0.269, 0)
End
If
End
If
Part.ClearSelection2(True)
Part.WindowRedraw()
End
Sub
Public
swApp As
SldWorks
End
Class