MACRO LIBRARY

Get the text and custom property link of a note

Free public access. No account or subscription required.

Files

Get the text and custom property link of a note

Code

'Written by Keith Rice
'CADSharp LLC
'www.cadsharp.com
    
'Preconditions: drawing is open
'Postconditions: note text and the custom propery to which the note is linked are _
    displayed in immediate window
    
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
    
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swDraw = swModel
    Set swView = swDraw.GetFirstView
    While Not swView Is Nothing
        Set swNote = swView.GetFirstNote
        While Not swNote Is Nothing
            Debug.Print swNote.GetText
            Debug.Print swNote.PropertyLinkedText
            Set swNote = swNote.GetNext
        Wend
        Set swView = swView.GetNextView
    Wend
End Sub