×
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

How to load a model in the context of the root assembly in Teamcenter?

How to load a model in the context of the root assembly in Teamcenter?

How to load a model in the context of the root assembly in Teamcenter?

(OP)
Hello,

I need a way to load a model into NX in the context of the root assembly from Teamcenter using NXOpen. I am not sure how to do this. Typically one would do this from Structure Manager, where you can search for a model in the context of the root assembly, and it will find and launch the assembly into NX with the model loaded for you. I tried doing this with a journal recording in progress but it didn't really yield any helpful results. This is all it produced.

CODE

Module NXJournal
Sub Main (ByVal args() As String) 

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim part1 As NXOpen.Part
part1 = theSession.Parts.Display

Dim workPart As NXOpen.Part = theSession.Parts.Work

Dim displayPart As NXOpen.Part = theSession.Parts.Display

Dim envValue1 As String
envValue1 = theSession.GetEnvironmentVariableValue("PRECISION_VALUE")

workPart.Preferences.UserInterface.DialogBoxDecimalPlaces = 3

Dim theUI As NXOpen.UI = NXOpen.UI.GetUI()

theUI.UserInterfacePreferences.DialogBarDecimalPlaces = 3

theUI.UserInterfacePreferences.ListingDecimalPlaces = 3

theSession.LogFile.WriteLine("Successfully updated precision values to default...")

Dim part2 As NXOpen.Part
part2 = theSession.Parts.Display

Dim fullPath1 As String
fullPath1 = workPart.FullPath

Dim historyList1() As NXOpen.BasePart.HistoryEventInformation
historyList1 = workPart.GetHistoryInformation()

Dim part3 As NXOpen.Part
part3 = theSession.Parts.Display

Dim fullPath2 As String
fullPath2 = workPart.FullPath

Dim historyList2() As NXOpen.BasePart.HistoryEventInformation
historyList2 = workPart.GetHistoryInformation()


Dim part4 As NXOpen.Part
part4 = theSession.Parts.Display

Dim fullPath3 As String
fullPath3 = workPart.FullPath

Dim historyList3() As NXOpen.BasePart.HistoryEventInformation
historyList3 = workPart.GetHistoryInformation()


Dim part5 As NXOpen.Part
part5 = theSession.Parts.Display

Dim fullPath4 As String
fullPath4 = workPart.FullPath

Dim historyList4() As NXOpen.BasePart.HistoryEventInformation
historyList4 = workPart.GetHistoryInformation()

Dim part6 As NXOpen.Part
part6 = theSession.Parts.Display

Dim fullPath5 As String
fullPath5 = workPart.FullPath

Dim historyList5() As NXOpen.BasePart.HistoryEventInformation
historyList5 = workPart.GetHistoryInformation()

Dim part7 As NXOpen.Part
part7 = theSession.Parts.Display

Dim fullPath6 As String
fullPath6 = workPart.FullPath

Dim historyList6() As NXOpen.BasePart.HistoryEventInformation
historyList6 = workPart.GetHistoryInformation()

Dim markId1 As NXOpen.Session.UndoMarkId
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Enter Gateway")

Dim part8 As NXOpen.Part
part8 = theSession.Parts.Display

Dim fullPath7 As String
fullPath7 = workPart.FullPath

Dim historyList7() As NXOpen.BasePart.HistoryEventInformation
historyList7 = workPart.GetHistoryInformation()

Dim markId2 As NXOpen.Session.UndoMarkId
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Enter Modeling")

theSession.CleanUpFacetedFacesAndEdges()

' ----------------------------------------------
'   Menu: Tools->Journal->Stop Recording
' ----------------------------------------------

End Sub
End Module 

Only this does not help me much. Does anybody know how to do this in NXOpen?

RE: How to load a model in the context of the root assembly in Teamcenter?

I don't understand the purpose, can you clarify ?

Regards,
Tomas

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