Journal Questions
Journal Questions
(OP)
I have a few journals that I would like to make more useful, but I am running into dead ends. I am guessing that several of these are not possible, but it is worth asking. I am using NX 7.5
1. Switching between applications (Drafting/Modeling)
2. Update Parts List in drawing. It seems that anything todo with tables is not recorded.
3. After exporting a PDF, open it in Adobe so I dont have to go find it in Teamcenter.
Thanks
1. Switching between applications (Drafting/Modeling)
2. Update Parts List in drawing. It seems that anything todo with tables is not recorded.
3. After exporting a PDF, open it in Adobe so I dont have to go find it in Teamcenter.
Thanks





RE: Journal Questions
CODE
Imports System
Imports NXOpen
Imports NXOpen.UF
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
'update all parts lists
'ufs.Plist.UpdateAllPlists()
'alternate method, useful if there are multiple parts lists but you only want to update certain ones
Dim myPListTags() As Tag = Nothing
Dim numberOfPlists As Integer
'return array of tags of all parts lists in file
ufs.Plist.AskTags(myPListTags, numberOfPlists)
lw.WriteLine("Number of Parts Lists: " & numberOfPlists)
For Each listTag As Tag In myPListTags
lw.WriteLine(" Tag: " & listTag.ToString)
ufs.Plist.Update(listTag)
Next
lw.Close()
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
End Function
End Module
CODE
Imports System
Imports NXOpen
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
'change following variable to point to a valid pdf file on your system
Dim pdfToOpen As String = "C:\temp\test.pdf"
Try
Diagnostics.Process.Start(pdfToOpen)
Catch ex As ApplicationException
lw.WriteLine(ex.ToString & " : " & ex.Message)
End Try
lw.Close()
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
End Function
End Module
www.nxjournaling.com
RE: Journal Questions
Those were both very helpful. Unfortunately I can't figure out how to get it to find the Teamcenter path when opening PDFs.
I know our manifestations use the format
@DB/12345678/A/manifestation/12345678_A_dwg and that works with
theSession.Parts.OpenBaseDisplay(), but I have tried every possible combination and I can't get Diagnostics.Process.Start()
to find a PDF in teamcenter.
I tried using PDM.FileManagement.ExportFiles(.. to export the pdf to a temp folder then open it, but I am not smart enough to get ExportFiles working.
RE: Journal Questions
yep anything with tables is not recorded. So I've got question how to sort table by journal? Or how I can get all functions assigned to "ufs.Plist"? I know NXOpen API Reference... but where exactly?
RE: Journal Questions
If you find something useful by using the search function, you can then press the "Locate" button and it will expand the contents list to show you where it is located within the help structure.
www.nxjournaling.com