Hi,
Below is the sample i am trying to get all note(s) names in a current drawing sheet or drawing sheet name of a selected note but it's not working. Can some one help me in this.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports NXOpen.Utilities
Imports NXOpen.Annotations
Imports NXOpen.Drawings
Module GetWordInfo
Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = s.ListingWindow
Sub Main()
Dim dp As Part = s.Parts.Display
Dim nc As NoteCollection = dp.Notes
Dim wp As Part = s.Parts.Work
Dim dwgs As Drawings.DrawingSheetCollection
Dim sheetTag As Tag = Nothing
dwgs = dp.DrawingSheets
Dim notestring() As String
lw.Open()
'Dim laSheet As DrawingSheet = wp.DrawingSheets().CurrentDrawingSheet
'For Each notename As Note In laSheet.Notes
'lw.WriteLine(notename.Name)
'Next
For Each sheet As Drawings.DrawingSheet In dwgs
sheet.Open()
For Each a_note As Note In nc
notestring = a_note.GetText()
lw.WriteLine(sheet.Name & " , "& a_note.DrawingSheetname & " , "& notestring(0) )
Next
Next
end1:
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module