I don't think it is accessable. You can search for a note with the text that it should have or you can rename the notes on the template and search for them by name.
'You can pass an string to this function to rename a selected note with that string.
Function SetNoteName(NewName As String)
Dim MyNote As SldWorks.note Dim FoundMyNote As Boolean Dim SelMgr As SldWorks.SelectionMgr Dim LPCALLOUT As Callout Dim userName As String
Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Set Part1 = Part.Extension
' Get the selection manager class
Set SelMgr = Part.SelectionManager()
' If user has selected something
If (SelMgr.GetSelectedObjectCount 0) Then
' Get the first item in the selection list
Set MyNote = SelMgr.GetSelectedObject2(1)
' If selected object is a note
If (SelMgr.GetSelectedObjectType(1) = 15) Then
' Change the name of the note
ret = MyNote.SetName(NewName)
' End if selected object was note or not
End If
Else MsgBox "There is nothing selected" End ' End if there is an object selected
End If
End Function
'Then you can get the text of the Note you just renamed with this function
Function GetNotesTextByName(NoteName As String) As String
Dim count As Integer
Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Set swSheet = Part.GetCurrentSheet()
Get_User_Name.GetUserName
Set swView = Part.GetFirstView Set swNote = swView.GetFirstNote
'search all text in drawing for one with the passed name While Not swNote Is Nothing If swNote.GetName = NoteName Then GetNotesTextByName = swNote.GetText Exit Function End If Set swNote = swNote.GetNext Wend
MsgBox "A note with the name " & VBA.Chr(34) & NoteName & VBA.Chr(34) & " was not found on this sheet."
Dim swApp As Object Dim SelMgr As Object Dim Nb_Prop As Long Dim La_Liste As Variant
Set swApp = CreateObject("SldWorks.Application")
Set Model = swApp.ActiveDoc
'Edition des plans uniquement..... If (Model Is Nothing) Or (Model.GetType swDocDRAWING) Then Exit Sub End If
'Trouve le nombre de propriétés Nb_Prop = Model.GetCustomInfoCount2(configuration) 'Extrait la liste des propriétés dans une liste (tableau) La_Liste = Model.GetCustomInfoNames() '(configuration) For T = 0 To Nb_Prop - 1 Step 1 Debug.Print T + 1, La_Liste(T), Model.CustomInfo2(configuration, La_Liste(T)) Next T
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.