Venkadakrishnan
Automotive
- Jun 23, 2014
- 6
thread561-352708
Hi The below Journal doest work for label notes, NX 8.5... can somebody help me here
Hi The below Journal doest work for label notes, NX 8.5... can somebody help me here
Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports NXOpen.Utilities
Imports NXOpen.Annotations
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 textin As String = "text to find"
Try
textin = NXInputBox.GetInputString("Get Note Info", "Text to Find", textin)
Catch ex As Exception
GoTo end1
End Try
Dim dwgs As Drawings.DrawingSheetCollection
dwgs = dp.DrawingSheets
Dim notestring() As String
lw.Open()
For Each sheet As Drawings.DrawingSheet In dwgs
sheet.Open()
For Each a_note As Note In nc
notestring = a_note.GetText()
If notestring(0) = textin Then
lw.WriteLine(sheet.Name & " , " & notestring(0))
End If
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