Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

User Exit on Save 2

Status
Not open for further replies.

Mukundh

Mechanical
May 4, 2012
51
What is the user exit for Save All in NX

For save/save work part only we have ufput()
 
Replies continue below

Recommended for you

Note that you can also use MenuScripts to provide pre- and post- actions on any menu item. Below is the sample code for a .men file which if found in your start-up folder in your user_defaults folder which will cause a program to be executed when you select the File -> Save-As... menu item:

*******************************************

! Add custom menu items or customizations
! Revised: 20 Feb 2004
! Note: Actions lines are 132 chars max.
!
VERSION 120

EDIT UG_GATEWAY_MAIN_MENUBAR

MODIFY

BUTTON UG_FILE_SAVE_AS
ACTIONS/PRE <path to executable program>

END_OF_MODIFY


*******************************************

The ACTIONS/PRE opti
on will execute the program BEFORE the Save-As is performed, while an ACTIONS/POST will cause the program to execute AFTER the Save-As operation is performed.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
so, what is the difference between user exit and a pre action.

I want my program to be triggered before saving of parts.
 
It depends on what you want to do in your program when you do a Save All.

Using the menuscript ACTION/PRE your program will execute then the internal NX code for Save All will execute.

Using the user exit for Save All, you will have to include the save function in your program for all parts in your assembly.

Menuscripts run before or after the NX code, user exits replace the NX code.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
For Pre-Actions can we send any arguments in the menu file.
 
Mukundh,

Sending arguments from menuscript ACTIONS/ to a dll is currently not supported.

Regards, Joe
 
Hi Jpetach,

Menu file itself sends the argument to the ufusr/main with the button.

 

Hi Mukundh,

You are correct.


At the risk of straying further away from the original menuscript topic... ;-)

NX 8.5 will provide formal support for argument passing for NXopen and Journal programs using the "Customize" user interface.

Please see the attachment for the new dialog.

Regards, Joe
 
 http://files.engineering.com/getfile.aspx?folder=5a1271d1-91ef-479d-90ce-eccfb76f2005&file=329094.JPG
Hi

Pre/post action and userexit are not triggered with program save (Saving part automatically in program)

Is there any way we can trigger pre/post action utilities.
 
What do you mean by "saving part automatically"? If you have an automated save function that is triggered by a menu or a timer, then I would not expect the pre/post or user exits to work.
The pre/post menu script options and the user exit are triggerred by selecting File/Save, ctrl/S or the Save icon. Any other method will not run the programs associated with the Save function.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Hi Loosli,

Good that you have mentioned "pre/post or userexit" will not work with automated save function. But, if we want to trigger or execute the utility is there any way for it...?
 
How are you triggering the automatic save?
How does the automatic save work?
Is it a program written by someone for you?

If I remember right, there is no built-in auto-save in NX. They eliminated it at UG2-V10 in 1994!

If you have a custom program for auto-save, can it be modified to incorporate your pre/post save requirements?
What does your pre/post save function do?
Is there another method that would accomplish what you need?


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Hi Loosli,

I have written a utility which will update the drawing views and save's part in program. But, when execute this program Pre\Post and user exit is not triggered. So, I want to check for any way to handle the pre\ post actions.

 
Just call the program(s), that you would have run as a pre/post action, at the appropriate point during the execution of the utilty program itself.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
John,

How do we execute utility in ufunc program. Is there any relevant call (For NXOPen we have Session.Execute()) can you suggest similar call in ufunc


Thanks in advance
Mukundh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor