Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Parts List with Journal

Status
Not open for further replies.

Techomick

Mechanical
Jun 21, 2011
46
0
0
US
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
 
Replies continue below

Recommended for you


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
 
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
 
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
 
Status
Not open for further replies.
Back
Top