Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

UG NX3 switch to Modeling in journal script 1

Status
Not open for further replies.

UMo

Automotive
Oct 1, 2007
2
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
 
Replies continue below

Recommended for you

After I opened a part file I created this journal. Not certain if this is what you are looking for.


' 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
 
Jackley,

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
 
You know, I didn't even bother testing this before I posted (obvious I know).

I'm new to the macros so bear with me.

Justin Ackley
Designer
 
"Dim session_UndoMarkId1 As Session.UndoMarkId
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
 


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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor