AnsweredAssumed Answered

link note to custom property

Question asked by Jordan Wigley on Jul 11, 2015
Latest reply on Jul 11, 2015 by Jordan Wigley

I want to link a note on a drawing such as the revision note on a title block to the custom property Revision in the file properties. I attempted to write a macro to do so, but instead of linking the two, it instead just changes the text of the note to "$PRP:\Revision\". Any help would be appreciated.

 

Dim swApp As SldWorks.SldWorks

Dim currentDrawingDoc As Object

Dim currentModel As Object

Dim view As Object

Dim SelMgr As Object

Dim note As Object

Const swSelNotes = 15

Const swDocDRAWING = 3

Dim boolstatus As Boolean

 

Sub main()

Set swApp = Application.SldWorks

Set currentModel = swApp.ActiveDoc

 

If (currentModel Is Nothing) Or (currentModel.GetType <> swDocDRAWING) Then

    swApp.SendMsgToUser ("No drawing open")

    Exit Sub

End If

 

Set currentDrawingDoc = currentModel

 

currentDrawingDoc.EditTemplate

 

Set view = currentDrawingDoc.GetFirstView

 

Set note = view.GetFirstNote()

 

Do While Not note Is Nothing

      

    If (note.GetName = "Revision") Then

       

        note.PropertyLinkedText = "$PRP:\Revision\"

               

        boolstatus = currentDrawingDoc.ForceRebuild3(True)

        Exit Do

    End If

    Set note = note.GetNext

Loop

End Sub

Outcomes