Cancel
Showing results for 
Search instead for 
Did you mean: 

find the sheet in which notes resides in nx drawing

Creator
Creator

Hi,

 

I was trying to extact the sheet name in which the notes resides.

 

Below Journal only extracting the Current sheet name. But my requirement is to extract all the sheet name in which note resides (Sh1,Sh2....).

 

-------------------------------------------------

Option Strict Off

Imports System

Imports NXOpen

Imports NXOpen.Drawings

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 lw As ListingWindow = s.ListingWindow

        lw.Open()

       Dim noteText() As String

       Dim numLines As Integer = 0

       For Each a_note As Note In nc

            noteText = a_note.GetText()

            numLines = noteText.Length

           For i As Integer = 0 To numLines - 1

               If noteText(i).Contains("510k") Then

                    lw.WriteLine("We found a 510 k")

                    lw.WriteLine(s.Parts.Work.DrawingSheets.CurrentDrawingSheet.Name)

               End If

           Next

       Next

 

   End Sub

 

End Module

 

 

------------------------------------------

 

What to change in the code above to get all the sheet names in which notes resides?

Kindly do the needful.........

4 REPLIES

Re: find the sheet in which notes resides in nx drawing

Honored Contributor
Honored Contributor

See the "AskDrawingSheet" function in the GTAC solution database:

http://solutions.industrysoftware.automation.siemens.com/view.php?si=nx_api4936

Re: find the sheet in which notes resides in nx drawing

Esteemed Contributor
Esteemed Contributor

By default, a specific note object will only reside in one sheet (there are ways to make it show in more than one)

 

Now you may have multiple note objects that DISPLAY the same (e.g. a note as part of a title block) but those are separate objects, just with the same text/value.

 

I suppose if you have PMI in a view, and you add that view to multiple sheets, you could have PMI notes on multipe sheets.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Highlighted

Re: find the sheet in which notes resides in nx drawing

Siemens Phenom Siemens Phenom
Siemens Phenom

Building on Ken's comments, you can pass the Tag of each note to UFView.AskViewDependentStatus.

 

The third parameter will be a string to indicate the view in which the note is view dependent.  Sometimes that might be a member view, but usually it will be the special view that represents one of the drawing sheets.

 

See attached.

Re: find the sheet in which notes resides in nx drawing

Creator
Creator

Its working..Smiley Happy

 

Thanks SteveLabout....