NX9 Navigator Order Journal
NX9 Navigator Order Journal
(OP)
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.





RE: NX9 Navigator Order Journal
You could try:
if (theNxDataController.NXPart.ComponentAssembly.RootComponent == null)
&& (theNxDataController.NXPart.ComponentAssembly.RootComponent.GetChildren().Length == 0)
Paul
Paul Turner
CAD & Process Engineer
Mastip Technology
RE: NX9 Navigator Order Journal
To be honest, I am not sure where to insert your code to my setup journal, as everytime I try it, it keeps giving me errors.
'IF' must end with a matching 'End If'
'theNXDataController' is not declared.
Expression Expected
'null' is not declared. 'Null' Constant is no longer supported; use 'System.DBNull' instead.
Syntax Error.
I think it would be best if you helped me as if you were teaching a child to tie his shoes. .... Though I am guessing there are no Bunny Ear tricks in Journal Code. lol