×
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

Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

(OP)
I have created a macro that changes the assembly load options in NX (NX 8 in my case)

I would like to run this macro at the startup of NX (Integrated with TC)

Do I need to modify change the ugii.bat file to run the .macro file ? If so how should I do it? Or please suggest if there is any other better way.

Thanks
FJ

RE: Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

I think I do not sure

Try this GTAC journal

and place the statement that run your macro in the
'
' TODO: Add your application code here
'
Option Strict Off

Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

' NX Startup
' This entry point activates the application at NX startup

' This will work when complete path of the dll is
' in the Environment Variable USER_STARTUP
' (or USER_DEFAULT, but then it runs at ALL user exits)
'
' Note that this does NOT run as a Journal - it must be
' built into a .DLL first.

Function Startup(ByVal args As String()) As Integer

Dim s As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim theUfSession As UFSession = UFSession.GetUFSession()

' TODO: Add your application code here

s.LogFile.WriteLine(" ")
s.LogFile.WriteLine(" ")
s.LogFile.WriteLine(" ")
s.LogFile.WriteLine("THE STARTUP PROGRAM IS RUNNING.")
s.LogFile.WriteLine(" ")
s.LogFile.WriteLine(" ")
s.LogFile.WriteLine(" ")

Return 0

End Function

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module

RE: Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

(OP)
a984928, Thanks for your comments, but do you have a suggestion on which *.dll I can use these codes?

RE: Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

The DLL is got from compiling this journal
after inserting your executing macro statement

Again I am not sure
you need to try it

RE: Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

Why A macro? just change it in the customer default settings.

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2
HPZ420 Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz, 32 Gb Win7 64B
Nvidea Quadro4000 2048MB DDR5

HP Zbook15
Intel(R) Core(TM) i7-4800MQ
CPU @ 2.70 GHz Win7 64b
Nvidia K1100M 2048 MB DDR5

RE: Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

1 ) Why do you do / want this ?

2) if it is for yourself only , or a very few users on the same site, you can in the load options dialog , 1) set the settings you like 2) press the button "save as default". The next time NX starts it will read your settings. done. No macro.
2.5, you can in the load options dialog open existing load options files, in case you have different settings in different projects.

3)If there are more users on your site, you might want to set up a common load options file for all users , then you can set a "windows variable" UGII_LOAD_OPTIONS such that , when you start NX it Loads the load_loptions.def -file you pointed out with the variable.
something similar to : UGII_LOAD_OPTIONS = D:\nxconfig\startup\load_options.def ( the file can have any name)


See my post ( the post #4) on http://www.eng-tips.com/viewthread.cfm?qid=414165
(i.e i would set the UGII_LOAD_OPTIONS in the ugii_env.dat)

Regards,
Tomas

RE: Running a ASSEMBLY LOAD OPTION Macro at the Startup of NX (Integrated with TC)

I agree with Toost. Also, calling an NX macro from journal code is not supported.

www.nxjournaling.com

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