Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IFRs on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read all the notes in my drawing using NXOpen in NX 7.5 ?

Status
Not open for further replies.

biw01

Automotive
Dec 31, 2011
152
Hello Everyone ,

Can someone please let me know how can i read all the drawing notes in my drawing using NXOpen(i.e the Note Text , Origin etc) as i did not find any way to get the note collection in my drawings ?
A sample code snippet will be of good help.
Your help in this regard will be deeply appreciated.

Regards,
Amitabh
 
Replies continue below

Recommended for you

This is an example from UGAnswer web site.

Code:
Option Strict Off

Imports System
Imports NXOpen
Imports NXOpen.Annotations

Module report_all_notes_text

  Dim s As Session = Session.GetSession()
  Dim lw As ListingWindow = s.ListingWindow
  Dim dp As Part = s.Parts.Display
  Dim nc As NoteCollection = dp.Notes

Sub Main()

    lw.Open()

    For Each a_note As Note In nc
        Dim the_text() As String = a_note.GetText()

        lw.WriteLine("Note has " & the_text.Length.ToString & " lines")
        Dim ii As Integer

        For ii = 0 To the_text.Length - 1
            lw.WriteLine(the_text(ii))
        Next
        lw.WriteLine("")
    Next

End Sub

  Public Function GetUnloadOption(ByVal dummy As String) As Integer

      Return Session.LibraryUnloadOption.Immediately

  End Function

End Module

Suresh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor