Hello,
I need reading the GENERAL NOTES field. I know that this attribute is "GEN_NOTE01" for the first line, but in this field have about 99 lines.
The code bellow is not work:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.UF
Imports System.Windows.Forms
Module Module1
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim dispPart As Part = theSession.Parts.Display
Dim blnGatheringInfo As Boolean = True
Sub Main()
Dim A As String
Dim A1 As String
Dim A2 As String
Dim R As String
Dim i As Integer
Dim Max As Integer
Dim Tag as String
Dim Test As String
Dim Test2 As String
Dim W As String
Max = 99
R = 0
A = """"
For i = 1 to Max
Messagebox.Show(i)
Test = A & "GEN_NOTE"&format(i,"##00")& A
Messagebox.Show(Test)
Test2 = thesession.Parts.Display.GetStringAttribute(A & "GEN_NOTE"&format(i,"##00")& A)
Messagebox.Show(Test2)
A1 = Test2
A2 = "SD "
R = Instr(A1,A2)
If R <> 0 then
Tag = thesession.Parts.Display.GetStringAttribute(Test)
Exit For
End If
Next i
Messagebox.Show(Tag + vbCrLf + R,"Resposta",MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
End Function
End Module
Can anyone help me?
Tks
Minoru
re: get attribute text
What is it about the code that doesn't work? Do you get error messages (if so, what are they), or does the code not give the expected results (what result do you expect / what actually happens)?
Finally, what version of NX are you using?
I have some general
I have some general information filled in notes field of each file. This code shows in a faster mode screen. I created a loop to perform the reading of all lines. The error it shows is that the field was not found, but there is information completed. I'm using version 8.5.
Thank you
re: notes vs. attributes
In your description, it sounds like you want to read notes that are displayed on a drawing sheet, but your code is looking for attributes. What are you trying to read, notes or attributes?
I am trying to read
I am trying to read attributes.
thesession.Parts.Display.GetStringAttribute("GEN_NOTE01") this function Ok!
For i = 1 to Max
Test2 = thesession.Parts.Display.GetStringAttribute(A & "GEN_NOTE"&format(i,"##00")& A)
Next i
Issue!
Anyone help me?
re: get attributes
Are you dealing with an array of attributes?
If you could email me a screenshot of the attribute list, or better yet, a sample NX file it would really help diagnose your issue (info@nxjournaling.com).