Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

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

Status
Not open for further replies.

mdfathmi

Mechanical
Apr 22, 2016
7
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

 
Replies continue below

Recommended for you

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
 
a984928, Thanks for your comments, but do you have a suggestion on which *.dll I can use these codes?
 
The DLL is got from compiling this journal
after inserting your executing macro statement

Again I am not sure
you need to try it
 
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

 
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 (i.e i would set the UGII_LOAD_OPTIONS in the ugii_env.dat)

Regards,
Tomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor