Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Open TeamCenter Item from NX Navigator

Status
Not open for further replies.

Barnon

Mechanical
Jul 23, 2016
97
Seems like you should be able to click on a component in the NX navigator and open that Item in TC. Only way I've found is to right click the component copy the name from properties and paste it in TC item search.

Years back when I worked for this company I wrote a grip that would suck out the part name by selecting a component from the Navigator, file to a text file and startup a AutoHotkey script that would take that Item name and past to the TC search window. Now they have the Blade Server permissions so I can't even run a AHK script.

We're running NX 12 BTW
 
Replies continue below

Recommended for you

If you right-click on your component, you have the option "Teamcenter Information".
This should bring you to Teamcenter and show the part you had selected.

But...most probably it will bring you to the Teamcenter Navigator in NX, not to the rich client.
Can't test this because we have Active Workspace as Navigator in NX

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Hi Didier.

I don't seem to get any option to open TC from the NX Navigator.

open_hpyhjl.png
 
Thx NutAce.

You're correct it does open select component in an NC Active Workspace. I'm not used to working in that space (maybe I should be). Doesn't seem like I have all the options as in the real TC client.
 
To my knowledge this action does not exist.
If you run the "Active Workspace", a dedicated Teamcenter tab will exist in NX , with some of Teamcenters capabilities enabled.
I think for example that you can release an item from the Active workspace in NX.

I do know that the option to, easily, open a related drawing from NX when you have the model loaded will be implemented "soon". ( i have no date nor NX version)

Regards,
Tomas

 
This is the Journal I use to pull up drawings from the Models in the Navigator. I think I got it from this site. I had to add buttload of extra extensions since we don't seem to follow any specific naming convention for our drawings.

Option Strict Off


Imports System

Imports System.Collections.Generic

Imports System.IO

Imports System.Windows.Forms

Imports NXOpen

Imports NXOpen.Assemblies

Imports NXOpen.UF

Imports NXOpen.UI

Module NXJournal


Dim theSession As Session = Session.GetSession()

Dim workPart = theSession.Parts.Work

Dim theUFS As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession()

Dim theUI As UI = ui.GetUI

Dim curSession As NXOpen.Session = NXOpen.Session.GetSession()

'Dim lw As ListingWindow = theSession.ListingWindow

Dim lg As LogFile = theSession.LogFile


Dim SelectedList As New List(Of String)

Dim bolSelected As Boolean = False


Dim objSelected As NXObject

Dim intType As Integer

Dim intSubType As Integer

Dim ExtensionList As New List(Of String)

Dim blnFoundSpec As Boolean = False



Sub Main()

'lw.Open()

lg.WriteLine("~~ Journal: Open_Specification.vb ~~")

lg.WriteLine(" timestamp: " & Now)


BuildExtensionList()


Try

lg.WriteLine(" Find out if components are selected.")

AreComponentsSelected()

If bolSelected = False Then

lg.WriteLine(" No components are selected.")

lg.WriteLine(" Open drawing for current work part.")

OpenDrawings(workPart.GetStringAttribute("DB_PART_NO") & "/" & workPart.GetStringAttribute("DB_PART_REV"))

OpenDrawings2(workPart.GetStringAttribute("DB_PART_NO") & "/" & workPart.GetStringAttribute("DB_PART_REV"))

Else

For Each selectedcomponent As String in SelectedList

lg.WriteLine(" Components are selected.")

lg.WriteLine(" Open drawing for selected parts.")

OpenDrawings(selectedcomponent)
OpenDrawings2(selectedcomponent)


Next

End If

If blnFoundSpec Then

curSession.ApplicationSwitchImmediate("UG_APP_DRAFTING")

Else

MessageBox.Show("(NO DWG found)", "", MessageBoxButtons.OK, MessageBoxIcon.Stop)

End If


Catch ex As Exception

lg.WriteLine(" Error in Sub Main: " & ex.Message)

End Try

'lw.Close()

lg.WriteLine("~~ Journal: Open_Specification.vb completed ~~")

lg.WriteLine(" timestamp: " & Now)

End Sub


Sub AreComponentsSelected()

Try

Dim intNumSelected As Integer = theUI.SelectionManager.GetNumSelectedObjects()

If intNumSelected = 0 Then

bolSelected = False

Exit Sub

End If


For i As Integer = 0 To intNumSelected-1

objSelected = theUI.SelectionManager.GetSelectedObject(i)

theUFS.Obj.AskTypeAndSubtype(objSelected.Tag, intType, intSubType)

If intType = UFConstants.UF_component_type Then

Dim theComp As Component = DirectCast(objSelected, Component)

SelectedList.Add(theComp.DisplayName)

bolSelected = True

End If

Next

Catch ex As Exception

lg.WriteLine(" Error in Sub AreComponentsSelected: " & ex.Message)

End Try


End Sub


Sub BuildExtensionList()

'Add new extensions to this list.

'This list should be sorted by most commonly used extension as opening will be attempted in this order.

ExtensionList.Add("-1")

ExtensionList.Add("-Dwg")

ExtensionList.Add("-dwg")

ExtensionList.Add("-DWG")

ExtensionList.Add("_Dwg")

ExtensionList.Add("_dwg")

ExtensionList.Add("_DWG")
End Sub



Sub OpenDrawings(ByVal OpenMe As String)

Dim strExtension As String

Dim strSplitString() As String = Split(OpenMe, "/")

Dim strPartNo As String = strSplitString(0)

Dim strRevNum As String = strSplitString(1)

Dim strOpenString As String = ""


For Each strExtension In ExtensionList

Try

'MessageBox.Show("@DB/" & strPartNo & "/" & strRevNum & "/specification/" & strPartNo & "-" & strRevNum & strExtension)

strOpenString = "@DB/" & strPartNo & "/" & strRevNum & "/specification/" & strPartNo & "-" & strRevNum & strExtension


Try

theSession.Parts.SetNonmasterSeedPartData(strOpenString)

Dim prtBasePart As BasePart

Dim lsBasePart As PartLoadStatus

prtBasePart = theSession.Parts.OpenBaseDisplay(strOpenString, lsBasePart)

lsBasePart.Dispose()

blnFoundSpec = True

Exit For


Catch exc As Exception

Dim prtPart As Part = CType(theSession.Parts.FindObject(strOpenString), Part)

Dim lsPart As PartLoadStatus

Dim status1 As PartCollection.SdpsStatus

status1 = theSession.Parts.SetDisplay(prtPart, False, True, lsPart)

lsPart.Dispose()

blnFoundSpec = True

Exit For


End Try


Catch ex As Exception

lg.WriteLine(" Error in Sub OpenDrawings:")

lg.WriteLine(" " & ex.Message & ": " & strOpenString)

End Try

Next

End Sub

Sub OpenDrawings2(ByVal OpenMe As String)

Dim strExtension As String

Dim strSplitString() As String = Split(OpenMe, "/")

Dim strPartNo As String = strSplitString(0)

Dim strRevNum As String = strSplitString(1)

Dim strOpenString As String = ""


For Each strExtension In ExtensionList

Try

'MessageBox.Show("@DB/" & strPartNo & "/" & strRevNum & "/specification/" & strPartNo & strExtension)

strOpenString = "@DB/" & strPartNo & "/" & strRevNum & "/specification/" & strPartNo & strExtension


Try

theSession.Parts.SetNonmasterSeedPartData(strOpenString)

Dim prtBasePart As BasePart

Dim lsBasePart As PartLoadStatus

prtBasePart = theSession.Parts.OpenBaseDisplay(strOpenString, lsBasePart)

lsBasePart.Dispose()

blnFoundSpec = True

Exit For


Catch exc As Exception

Dim prtPart As Part = CType(theSession.Parts.FindObject(strOpenString), Part)

Dim lsPart As PartLoadStatus

Dim status1 As PartCollection.SdpsStatus

status1 = theSession.Parts.SetDisplay(prtPart, False, True, lsPart)

lsPart.Dispose()

blnFoundSpec = True

Exit For


End Try


Catch ex As Exception

lg.WriteLine(" Error in Sub OpenDrawings:")

lg.WriteLine(" " & ex.Message & ": " & strOpenString)

End Try

Next

End Sub


Public Function GetUnloadOption(ByVal dummy As String) As Integer

GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY

End Function

End Module



 
Why don't you use the Reference in Teamcenter to find it? for the selected 3D just find the Manifestation or Specification (don't know which relation is used in your Teamcenter) which is referenced by it.
Then you don't need to know the name.

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
NutAce.

I would like to learn about the method you speak of. The above program has worked flawlessly except for one part that I have changed the name many many times and it still will not work. The above program seems to be pulling them from the name shown in red below. How can I find out which relation is used?

TC_z5axon.jpg
 
You can find the relation using Impact analysis in Teamcenter.
Check if you have the Were referenced Pom option. If not, then you have to create it in the Teamcenter options as below.
Be careful, you have to use the exact upper and lower case in the preference naming, otherwise it will not work.
TC-impactAnalysis_y2qoma.png


Once created, select the UGPart. it will show the relations in the Impact analysis.
TC-WhereReferencedPom_iyoeux.png


Right-clik on the "clips" and select view properties.
TC-ReferenceProperties_i3ozt7.png


Do this for each clip until you find the one showing the UGPart as Primary reference and the UGMaster as Secondary.
It should show you the relations as shown below.
TC-RelationType_ut1qm6.png



I actually learned at PLM Europe last week, that the "Open Drawing" functionality will come in one of the next releases of NX. I believe it will be in NX1899

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Thanks NutAce. Is there another way in the Journal to access that directly?

tc_sa1sfj.jpg
 
I would say this is the easiest. The only other one I would say is looking for it by name, but then you have to have strict naming rules.

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor