I would like to list any note which include the parameter starting with "W!" (in a drawing).
In listing window I would also want to see the content of this parameter.
As I remember there was a code that lists the notes in a drawing. Could you please modify it?
Thanks
Here is a code sample from GTAC, does it do something similar to what you are looking for?
'Document Information
'
' Document ID: nx_api4708
' Date: Jan-31-2013
' Product: NX
' Submit By: Amy Webster
' API Type: NXOpen
' Language Ext: vb
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Module NXJournal
Dim theSession As Session = Session.GetSession()
Dim theUFSession As UFSession = UFSession.GetUFSession()
Sub Echo(ByVal output As String)
theSession.ListingWindow.Open()
theSession.ListingWindow.WriteLine(output)
theSession.LogFile.WriteLine(output)
End Sub
Sub Main(ByVal args As String())
Dim workPart As Part = theSession.Parts.Work
' The AssociativeText class is new in NX8
Dim translator As Annotations.AssociativeText = workPart.Annotations.CreateAssociativeText()
Dim status As Integer = Nothing
Dim isOn As String = Nothing
Dim trans_text As String = Nothing
For Each aNote As Annotations.Note In workPart.Notes
Echo(aNote.ToString)
theUFSession.View.AskViewDependentStatus(aNote.Tag, status, isOn)
If status = 1 Then
Echo(" resides on: " + isOn.Split("@")(0))
End If
Echo(" text is: ")
For Each text_line As String In aNote.GetText()
trans_text = translator.GetEvaluatedText(aNote, text_line)
If String.Compare(trans_text, text_line) = 0 Then
Echo(" " & text_line)
Else
Echo(" " & text_line & " => " & trans_text)
End If
Next
Next
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function
If your NX maintenance is up to date, you can log into the GTAC website to log a problem you are having and/or use the official NX user forum. You'll need a webkey and user account to log on, you can find more info here: http://support.industrysoftware.automation.siemens.com/gtac.shtml
Look at the menu items:
contact GTAC (speak to NX support personnel directly)
Webkey management (set up your account)
Siemens PLM forums (post messages for Siemens' employees and other NX users)
Go to: http://solutions.industrysoftware.automation.siemens.com/, log in, and you will be able to search the 'solution center'. Enter a term such as "vb.net nxopen sample" and you will get dozens of results. If you are looking for specific code, add more search terms to narrow your results.
re: parameters
Are you wanting to link attribute values into text notes?
What version of NX are you using? The way attributes are handled changed a bit in NX8.
I would like to list any note
I would like to list any note which include the parameter starting with "W!" (in a drawing).
In listing window I would also want to see the content of this parameter.
As I remember there was a code that lists the notes in a drawing. Could you please modify it?
Thanks
re: listing notes
Here is a code sample from GTAC, does it do something similar to what you are looking for?
'
' Document ID: nx_api4708
' Date: Jan-31-2013
' Product: NX
' Submit By: Amy Webster
' API Type: NXOpen
' Language Ext: vb
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Module NXJournal
Dim theSession As Session = Session.GetSession()
Dim theUFSession As UFSession = UFSession.GetUFSession()
Sub Echo(ByVal output As String)
theSession.ListingWindow.Open()
theSession.ListingWindow.WriteLine(output)
theSession.LogFile.WriteLine(output)
End Sub
Sub Main(ByVal args As String())
Dim workPart As Part = theSession.Parts.Work
' The AssociativeText class is new in NX8
Dim translator As Annotations.AssociativeText = workPart.Annotations.CreateAssociativeText()
Dim status As Integer = Nothing
Dim isOn As String = Nothing
Dim trans_text As String = Nothing
For Each aNote As Annotations.Note In workPart.Notes
Echo(aNote.ToString)
theUFSession.View.AskViewDependentStatus(aNote.Tag, status, isOn)
If status = 1 Then
Echo(" resides on: " + isOn.Split("@")(0))
End If
Echo(" text is: ")
For Each text_line As String In aNote.GetText()
trans_text = translator.GetEvaluatedText(aNote, text_line)
If String.Compare(trans_text, text_line) = 0 Then
Echo(" " & text_line)
Else
Echo(" " & text_line & " => " & trans_text)
End If
Next
Next
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function
End Module
Is there any solution for NX7?
Is there any solution for NX7?
But
Annotations.AssociativeText method is not working. Maybe it is not absent
re: AssociativeText
A comment in the code notes that AssociativeText only works for NX8 or newer. What version of NX are you using?
Hello, I am using Nx 7
thanks
How can I get support from GTAC
How can I get support from GTAC
re: GTAC support
If your NX maintenance is up to date, you can log into the GTAC website to log a problem you are having and/or use the official NX user forum. You'll need a webkey and user account to log on, you can find more info here:
http://support.industrysoftware.automation.siemens.com/gtac.shtml
Look at the menu items:
Thanks, I have signed.
done
GTAC search
Hello,
Could you tell me please how I can search that kind of codes on GTAC?
GTAC sample code
Go to: http://solutions.industrysoftware.automation.siemens.com/, log in, and you will be able to search the 'solution center'. Enter a term such as "vb.net nxopen sample" and you will get dozens of results. If you are looking for specific code, add more search terms to narrow your results.