Kenja824
Automotive
- Nov 5, 2014
- 949
In July of 2014, JPETACH posted this journal to change the Navigator Order
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim componentOrder1 As Assemblies.ComponentOrder = CType(workPart.ComponentAssembly.OrdersSet.FindObject("Chronological"), Assemblies.ComponentOrder)
componentOrder1.Activate()
End Sub
End Module
This works fine if you are in an assembly, however if you are in a single detail it errors out. I know.... why would I want to set the order in a single detail, right?
I have a set up button that most of us run to set a bunch of attribute for drafting preferences and such. We use this button for all files we work on. I would like to paste this into the set-up journal so that it will automatically set the Navigator order to Alphanumeric.
So I ask, can anyone please help me with a journal code that will set this order to assembly files and when you are in a single detail it simply gets ignored and doesnt error out?
I attached the Setup Journal I will add it to in case this will help the process.
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim componentOrder1 As Assemblies.ComponentOrder = CType(workPart.ComponentAssembly.OrdersSet.FindObject("Chronological"), Assemblies.ComponentOrder)
componentOrder1.Activate()
End Sub
End Module
This works fine if you are in an assembly, however if you are in a single detail it errors out. I know.... why would I want to set the order in a single detail, right?
I have a set up button that most of us run to set a bunch of attribute for drafting preferences and such. We use this button for all files we work on. I would like to paste this into the set-up journal so that it will automatically set the Navigator order to Alphanumeric.
So I ask, can anyone please help me with a journal code that will set this order to assembly files and when you are in a single detail it simply gets ignored and doesnt error out?
I attached the Setup Journal I will add it to in case this will help the process.