×
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

Insert Parts List with Journal

Insert Parts List with Journal

Insert Parts List with Journal

(OP)
Does anyone have any experience with inserting a parts list from a template with a journal/nxopen? GTAC doesn't seem to have any information. I have been playing with this on and off for several months with no success. I am using NX8.5

Thanks,
Andrew

Design Engineer, NX 7.5

RE: Insert Parts List with Journal

(OP)

I was able to do it in Naitive NX, but it does not seem to be possible to use a Teamcenter managed one like "@DB/DH_Parts_List_metric/A". Thought I would share what I was able to do though:

Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Utilities

Public Class NXJournal
Shared theSession As Session = Session.GetSession()
Shared theUFSession As UFSession = UFSession.GetUFSession()
Shared workPart As Part = theSession.Parts.Work

Private Shared Sub DoIt()
Dim markId1 As NXOpen.Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "")

Dim pl_tags() As Tag = Nothing
Dim n_pls As Integer = Nothing
theUFSession.Plist.AskTags(pl_tags, n_pls)
Dim PartsList As DisplayableObject = DirectCast(NXObjectManager.Get(pl_tags(0)), DisplayableObject)

If PartsList.Layer = 0 Then
Dim tab_name As String = "R:\Common\NX\programs\Drafting\DH_Parts_List_metric_A.prt"
Dim pattern_tag As NXOpen.Tag
Dim group As Tag
Dim tabular_note_section As NXOpen.Tag
Dim tabular_note As NXOpen.Tag
Dim ufs As UFSession = UFSession.GetUFSession()
Dim myTag As NXOpen.Tag
Dim origin() As Double = {-250, 0}
ufs.Plist.CreateFromTemplate(tab_name, origin, myTag) 'Create Parts List from Template
Dim my_plist As NXOpen.Tag = NXOpen.Tag.Null
Dim dispPartTag As NXOpen.Tag = theSession.Parts.Display.Tag
Dim traversalSettings1 As NXOpen.UF.UFPlist.TraversalSettings
traversalSettings1.master_model = True
traversalSettings1.top_level_only = True
ufs.Plist.SetTraversalSettings(myTag, traversalSettings1)
End If

End Sub

Public Shared Sub Main(ByVal args As String())
Dim workPart As Part = theSession.Parts.Work

If workPart IsNot Nothing Then
DoIt()
Return
End If

End Sub


Public Shared Function GetUnloadOption(ByVal arg As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function
End Class

Design Engineer, NX 7.5

RE: Insert Parts List with Journal

Do you have a pax file for the templates in TC? If so, try using the "presentation name" listed in the pax file of the desired template in place of the full file name.

I'm not currently running TC, so I'm not sure this will work, but I'd give it a try...

www.nxjournaling.com

RE: Insert Parts List with Journal

Also, the NX environment variable UGII_TABLE_TEMPLATES is involved with the .CreateFromTemplate command, though I'm not sure how it works with TC. With native NX, it points to a folder in the file system. Do you have this variable set? If so, what does it point to?

www.nxjournaling.com

RE: Insert Parts List with Journal

You should be able to set up simple program to import a part from teamcenter that has a Parts list inserted in it.

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