UG NX3 switch to Modeling in journal script
UG NX3 switch to Modeling in journal script
(OP)
Hello to everyone.
I'm new in the forum.
Does anybody know how to switch to Modeling application in UG NX inside a journal script?
Keyword search didn't help.
Thanks for help
UMo
I'm new in the forum.
Does anybody know how to switch to Modeling application in UG NX inside a journal script?
Keyword search didn't help.
Thanks for help
UMo





RE: UG NX3 switch to Modeling in journal script
' NX 3.0.5.3
' Journal created by on Mon Oct 01 08:49:00 2007 Eastern Daylight Time
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
' ----------------------------------------------
' Menu: Application->Modeling...
' ----------------------------------------------
Dim session_UndoMarkId1 As Session.UndoMarkId
session_UndoMarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Enter Modeling")
' ----------------------------------------------
' Menu: Tools->Journal->Stop
' ----------------------------------------------
End Sub
End Module
Justin Ackley
Designer
RE: UG NX3 switch to Modeling in journal script
I think all that journal will do is put an undo step in your undo list called enter modellijg but won't actually change the application.
As far as I'm awre this can't be done. That's the answer I've had for NX3 so far.
I've seen examples that check to see if the user is in modelling first and have an error catchment to warn the user they are in the wrong app but that's it.
Anyone have any insights into NX4 & 5 ??
Mark Benson
Aerodynamic Model Designer
RE: UG NX3 switch to Modeling in journal script
I'm new to the macros so bear with me.
Justin Ackley
Designer
RE: UG NX3 switch to Modeling in journal script
session_UndoMarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Enter Modeling")"
I tried this before and as Mark wrote it just sets an undo mark and doesn't switch to Modeling.
So I have to live with the VB-Runtime-Error-Message.
Ulrich Mothes
Designer
RE: UG NX3 switch to Modeling in journal script
Hi,
To get a prompting message for application module, you can use the piece of code
Imports System
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.Utilities
Imports NXOpen.UF
Public Module query
Public UFS As UFSession = UFS.getufsession
Public NTS As Session = NTS.getsession
Sub Main()
Dim appModule As Integer = 0
Try
UFS.UF.AskApplicationModule(appModule)
' / Check for modeling /
If Not (appModule = UFConstants.UF_APP_MODELING) Then
' / Prompt message /
MessageBox.Show(" User not in modeling application ", "INFO", MessageBoxButtons.OK)
End If
Catch ex As Exception
End Try
End Sub
End Module