×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

UG NX3 switch to Modeling in journal script

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

RE: UG NX3 switch to Modeling in journal script

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

RE: UG NX3 switch to Modeling in journal script

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

RE: UG NX3 switch to Modeling in journal script

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

RE: UG NX3 switch to Modeling in journal script

(OP)
"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

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources