×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Journal Questions

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

RE: Journal Questions

  1. Switching between applications: limited ability to do so has been added to NX 8, not possible in 7.5 or below. I have written journals that use drafting and/or modeling functions and they work no matter what application the journal is started from (so long as I have the proper license to use the functionality). I have not done much programming with CAM or other application functionality, so I can't confirm that is true across the board.
  2. Use UF functions, here is some sample code:

    CODE

    Option Strict Off  
    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  
  3. Here is some sample code for pdf files on disk (I'm not sure what happens if the pdf is stored in a teamcenter dataset, I don't currently have TC to test with):

    CODE

    Option Strict Off  
    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

(OP)
Thanks!
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

Hi guys,
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

NXOpen.UF Namespace -> UFPlist Class
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources