Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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
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
Dim dp As Part = s.Parts.Display
Dim wp As Part = s.Parts.Work
Sub Main()
Dim nc As NoteCollection = dp.Notes
Dim textin As String = "text to find"
Dim cnt1 As Integer = Nothing
Try
textin = NXInputBox.GetInputString("Get Note Info", "Text to Find", textin)
Catch ex As Exception
GoTo end1
End Try
Dim dwgs As Drawings.DrawingSheetCollection = wp.DrawingSheets
dwgs = wp.DrawingSheets
Dim notestring() As String
Dim viewtag As Tag = Tag.Null
Dim dc As DrawingSheetCollection = dp.DrawingSheets
lw.Open()
For Each sheet As DrawingSheet In dc
sheet.Open()
Dim objs() As DisplayableObject = sheet.View.AskVisibleObjects()
For Each obj As DisplayableObject In objs
Dim a_Note As Note = CType(obj, Note)
notestring = a_Note.GetText()
Dim nolines As Integer = notestring.Length
Dim found1 As Boolean = False
For i As Integer = 0 To nolines - 1
found1 = notestring(i).Contains(textin)
If found1 = True Then
lw.WriteLine(sheet.Name)
For j As Integer = 0 To nolines - 1
lw.WriteLine(" " & notestring(j))
Next
End If
Next
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