Searching Text in Drawings
Searching Text in Drawings
(OP)
Hello,
I am new to NX6, and I have been given a task to seach through all the text of a drawing and replce certain part numbers with new part numbers. The hard way would be to scan through the entire drawing and replace them, but I would like to know if there is any kind of Search option that will find a text string in the annotations. Similar to the ctrl+F in word, or any other microsoft application.
Any help would be appreciated.
Thanks!
I am new to NX6, and I have been given a task to seach through all the text of a drawing and replce certain part numbers with new part numbers. The hard way would be to scan through the entire drawing and replace them, but I would like to know if there is any kind of Search option that will find a text string in the annotations. Similar to the ctrl+F in word, or any other microsoft application.
Any help would be appreciated.
Thanks!
Eric Roe
Electro-Mechanical Engineer
Airfloat LLC





RE: Searching Text in Drawings
RE: Searching Text in Drawings
Eric Roe
Electro-Mechanical Engineer
Airfloat LLC
RE: Searching Text in Drawings
That being said, there is something which will give you what you're looking for. Open your drawing and export a PDF version of the drawing, setting the 'Output Text' option to 'Text'. Once you have the PDF version of your drawing then you can use the standard Adobe Reader 'Find' tool to detect and highlight any string of text on the face of the drawing.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum: http://www.plmworld.org/p/cm/ld/fid=209
To an Engineer, the glass is twice as big as it needs to be.
RE: Searching Text in Drawings
Thanks again for your help.
Eric Roe
Electro-Mechanical Engineer
Airfloat LLC
RE: Searching Text in Drawings
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
RE: Searching Text in Drawings
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports NXOpen.Utilities
Imports NXOpen.Annotations
Module ChangeNoteWord
Sub Main()
Dim s As Session = Session.GetSession()
Dim dp As Part = s.Parts.Display
Dim nc As NoteCollection = dp.Notes
Dim notetext1 As String = "existing word"
notetext1 = NXInputBox.GetInputString("Change Note", "Note word to be changed", notetext1)
Dim notetext2 As String = "new word"
notetext2 = NXInputBox.GetInputString("Change Note", "New note word", notetext2)
Dim notestring() As String
Dim nolines As Integer = 0
Dim found1 As Boolean = False
Dim m1 As Session.UndoMarkId = s.SetUndoMark(Session.MarkVisibility.Visible, "M1")
For Each a_note As SimpleDraftingAid In nc
notestring = a_note.GetText()
nolines = notestring.Length
For i As Integer = 0 To nolines - 1
found1 = notestring(i).Contains(notetext1)
If found1 = True Then
notestring(i) = notestring(i).Replace(notetext1, notetext2)
End If
Next
a_note.SetText(notestring)
Next
s.UpdateManager.DoUpdate(m1)
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module
Hope this helps.
Frank Swinkels
RE: Searching Text in Drawings
Eric Roe
Electro-Mechanical Engineer
Airfloat LLC
RE: Searching Text in Drawings
RE: Searching Text in Drawings
Eric Roe
Electro-Mechanical Engineer
Airfloat LLC