Showing results for 
Search instead for 
Did you mean: 

Running a journal file from an external application


So in order to programatically switch into the Modeling module, there's a function called ApplicationSwitchRequest in the MenuBarManager.  It takes in an application button name like "UG_APP_MODELING" and will attempt to switch to the target application once the journal or program that calls it finishes.  However, I need to switch into Modeling and keep my NX plug-in running.  I have a journal file that uses ApplicationSwitchRequest, and I was wondering if there was a way to have NX run a journal file programatically.  Then the journal file would complete, NX would switch to modeling, and I can go my merry way.  Does anybody know of a way to run a journal file from an external application, or another entirely different way of switching applications programatically?


Re: Running a journal file from an external application

Siemens Phenom Siemens Phenom
Siemens Phenom

Currently we don't really have a way to do that, but I believe an enhancement is planned in a future release that will allow you to actually switch to a different application module while your program is running, and continue with execution.


For now though, would it help at all if you could turn off the drawing sheet in your program, or expand one of the member views?  We have methods to do both of those.  Please see UF_DRAW_set_display_state() in Open C or the .Net wrapper, UFDraw.SetDisplayState(), as well as NXOpen.View.Expand().


Re: Running a journal file from an external application


Well, I did find a way to do it, but it's a super hacky workaround.  If you put a journal file in the applications folder of your executable and then put the name of that journal as one of the actions in the .men file entry for a custom button, it'll run the journal file when that button is pushed.  So if you put applicationSwitchRequest in that journal, NX will switch applications when your journal completes.  The problem now is that running a journal is so much slower than your application, if you want to do anything afterwards the timing is super hard to hit.  Any suggestions on being able to flag your application after a journal completes?

The issue isn't actually switching from Drafting to Modeling or vice versa, it's switching from Gateway to Modeling.  So SetDisplayState doesn't work in that case, I'm pretty sure.  Thanks though!  

Re: Running a journal file from an external application

Valued Contributor
Valued Contributor

Thinking along the lines of .men files.

Could you make your application change script a pre action?

This would then run and wait for it to complete before continuing the main action of the button?

Re: Running a journal file from an external application

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The existing ER number for the application switch through API is 1817973.

Ask GTAC to add you to this ER, so it gets more importance.


As others have suggested, would it be possible to split your plug-in into application specific pieces?


Using PRE and POST actions would allow you to change applications at least twice:

  1. execute PRE action
  2. change application when the DLL finishes
  3. execute action
  4. same as 2.
  5. execute POST action

I would try this approach.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 ( | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Running a journal file from an external application


Right, it's a /PRE action right now.  Funny I didn't think about that, actually.  I should just split up the second half of my action into the /POST action, huh.  Good catch.