Is there a way to link a new note to an existing drawing view? Manually doing this would be selecting the note and copy and pasting it onto the draw view. When the drawing view is moved, the text should follow.
Turns out if you Focus Lock the view, anything you create after that will be locked to the view so this works for my application.
Depending on what version of SW you are on you can right click on a note, select attach to view then select the view you want the note to be in.
"Manually doing this would be selecting the note and copy and pasting it onto the draw view."
That creates a copy of the Note, which is fine if that's what you want, but use cut and paste if you don't, which sounds like what you want here. If it has a leader another option is to just move the leader and attach it to the new view.
Do you mind if I ask why you want a macro to accomplish such a simple task? Not criticizing; just curious.
I think I'll try adding a leader to it.
I currently have a macro to export all sheetmetal flat patterns to our laser cutting template sequentially down the page and it also prints a note detailing the properties for that sheetmetal part. If someone wants to manually move the flat pattern, I want the note to follow it.
Also, before you create the note you can click in the proper view and when you create the note will be linked to the view you have highlighted.
Please note that this question is posted in the API section....
What you're looking for is 2017 SOLIDWORKS API Help - AttachAnnotation Method (IDrawingDoc)
Please read the "Remarks" section for usage notes.
Also review example:
2017 SOLIDWORKS API Help - Attach Annotation Example (VBA)
Retrieving data ...