Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX85 - remove a menu command? 1

Status
Not open for further replies.

daluigi

Industrial
Apr 17, 2010
216
Is it possible to remove an NX menu command for all users ?
 
Replies continue below

Recommended for you

Are you talking about removing an icon on a tool bar or menu item on a pull-down from the menu bar? If so, yes. However, if you're talking about an option or an item on a function's dialog, probably not.

Exactly what is it that you're looking to remove?

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.
 
I'am talking about a menu item on a pull-down from the menu bar.
To make things even more "simple" that menu item should be unaccessible for all users sharing our common NX customization (based the Startup folder, Application folder, etc.).
 
What item(s) is it that you want to remove?

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.
 
You have two choices, either make a copy of the 'ug_main.men' file (found at ...\UGII\menus) and remove the lines of text from the file which defines the 'Save All' options. Then place this edited .men file (don't change its name) in the 'Application' folder. Alternatively, you could create a Menufile which removes those same entries and place it in the 'Startup' folder. Either way, the 'Save All' commands will have been removed from the pull-down meanu.

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.
 
You have 2 choices to 'remove' the text that defines the 'save all' option: 1) turn the lines into 'comments' 2) delete the lines from the file.

I'd recommend the commenting option rather than deleting it entirely from the file; this makes it easy to revert back if needed. Marking a line as a comment usually involves adding a special character at the beginning of the line. In the .men files I think it is the "!" character; there should be other comments in the file, just follow suit.

Either route you take, make a backup copy of the original file before editing it.

www.nxjournaling.com
 
I like the 2nd option of modifying via an extra menu placed in the Startup folder.
I have tried the folowing place in a ".men" file but it does not work - any idea is welcome:

EDIT UG_GATEWAY_MAIN_MENUBAR
HIDE UG_FILE_SAVE_ALL

Thank you.
 
The use of Hide and an "Edit " .men file is good because it doesn't require editing OOTB files or risk getting overwritten by updates.
Some concerns:
Existing mtx files may still display the menu option if it had been previously displayed.
The key accelerator will still work for the operation so "finger memory" could be a loophole.

A variant would be to use the "edit" .men file to redefine the bitmap (do not use) and redefine the action to "redirect to a web page explaining that the function is intentional removed". This would insure that loopholes did not perform the original operation.

Code:
VERSION 121
EDIT UG_GATEWAY_MAIN_MENUBAR

MODIFY 
BUTTON UG_FILE_SAVE_ALL
BITMAP Delete
ACTIONS "start iexplore [URL unfurl="true"]http://your_site.com/this_function_disabled_page.html[/URL] "
END_OF_MODIFY
HIDE UG_FILE_SAVE_ALL

HTH, Joe
 
OK, there appears to be a bug in NX 8.5. Your file should have worked and it did, using NX 7.5, NX 8.0, NX 9.0 and even NX 10.0. I'll open a PR and let you know what I find. What's the exact version of NX 8.5 that you're running? I tested this using NX 8.5.3.3.

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.
 
Hi,
I've made this .men file :
Code:
VERSION 121
EDIT UG_GATEWAY_MAIN_MENUBAR

MODIFY 
BUTTON UG_FILE_SAVE_PART
LABEL &Save
TOOLBAR_LABEL Save
MESSAGE Saves the work part in ISO view.
SYNONYMS store, files, assembly
BITMAP filesave
ACCELERATOR Ctrl+S
ACTIONS "save_en_ISO.vb"
END_OF_MODIFY
but doesn't work.
When press the save button a DOS window open and close rapidly and I can't see what texts are present inside.
The code is correct because NX starts correctly.
What I wrong ?


Thank you...

Using NX 8 and PDM RuleDesigner
 
I don't see anything that that would cause a DOS window to open. That would seem to indicate that it's something in your VB program. Have you tried to execute it manually to see what happens?

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.
 
Cubalibre00,

Please use "Information, Custom Menu Bar, Custom Item Report", search the listing window for "UG_FILE_SAVE_PART".
If the "Actions:" line is followed by a line with the name of your vb file the the problem is in your VB file.
If the line following "Actions:" is "<actions not registered>" then your vb file is in the wrong place. Put the VB file in the "Application" sub-directory of any of the directories in ug_custom_dirs.dat E.g. UGII_SITE_DIR\application.

HTH, Joe
 
Joe,
with you suggestions I've resolved the problem.
Thank you.

Thank you...

Using NX 8 and PDM RuleDesigner
 
Hi,
the vb works in modeling and in assembly, not in drawing.
This custom .men, can exclude drawing environment ?

Thank you...

Using NX 8 and PDM RuleDesigner
 
Cubalibre00,

Not that I am aware of (while using an "Edit" style .men file).

Your VB program could check for the Drafting application and exit without doing anything if the program is run while in Drafting.

Code:
Option Strict On
Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As Session = Session.GetSession()
Dim theUfSession As UfSession = UFSession.GetUFSession()
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
Dim moduleId As Integer = -1
theUfSession.UF.AskApplicationModule(moduleId)
if moduleId = UFConstants.UF_APP_DRAFTING      
lw.WriteLine("We are in Drafting")
else
lw.WriteLine("Life is good")
end if
End Sub
End Module

HTH, Joe
 
Hi Joe,
your support has resolved my problem.
Thank you again.

Thank you...

Using NX 8 and PDM RuleDesigner
 
Hi Joe,
during the normal work I've found an exception in the Journal.
The journal works fine, but doesn't save the drawing if it's new, for example when I make a master model specification.
This is the code:
Code:
Option Strict On
Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As Session = Session.GetSession()
Dim theUfSession As UfSession = UFSession.GetUFSession()
Dim moduleId As Integer = -1
theUfSession.UF.AskApplicationModule(moduleId)
if moduleId = UFConstants.UF_APP_DRAFTING
Dim workPart As Part = theSession.Parts.Work      
Dim partSaveStatus1 As PartSaveStatus
partSaveStatus1 = workPart.Save(BasePart.SaveComponents.True, BasePart.CloseAfterSave.False)
partSaveStatus1.Dispose()
else
Dim workPart As Part = theSession.Parts.Work
workPart.ModelingViews.WorkView.Orient(View.Canned.Isometric, View.ScaleAdjustment.Fit)     
Dim partSaveStatus1 As PartSaveStatus
partSaveStatus1 = workPart.Save(BasePart.SaveComponents.True, BasePart.CloseAfterSave.False)
partSaveStatus1.Dispose()
end if
End Sub
End Module
Idea to resolve this exception, where I would like the save the new drawing.

Thank you...

Using NX 8 and PDM RuleDesigner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor