How to run a *.macro file from the menu file (*.men)?
How to run a *.macro file from the menu file (*.men)?
(OP)
Hello,
I have the problem to run *.macro file from my menu file.
Below I have pasted a part of code from the *.men file.
BUTTON my_button
LABEL My Button
ACTIONS $UGII_GROUP_DIR\macro\button.macro
What should be the format?
Regards
Jim
I have the problem to run *.macro file from my menu file.
Below I have pasted a part of code from the *.men file.
BUTTON my_button
LABEL My Button
ACTIONS $UGII_GROUP_DIR\macro\button.macro
What should be the format?
Regards
Jim





RE: How to run a *.macro file from the menu file (*.men)?
But that being said, the word is:
ACTION, not ACTIONS.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: How to run a *.macro file from the menu file (*.men)?
If I change ACTIONS to ACTION, UG won't run the menu file. I use Menu file, because I would like to share it with others.
Jim
RE: How to run a *.macro file from the menu file (*.men)?
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: How to run a *.macro file from the menu file (*.men)?
It is the same situation. I have tried replacing with the full path but it do not work.
RE: How to run a *.macro file from the menu file (*.men)?
I'm sorry to have to inform you that Menufiles (AKA, MenuScripts) do NOT support Macros!
While it's true that the documentation does not explicitly caveat that limitation, it also does not mention Macros when you look at the list of supported ACTIONS (and you're correct, in a Menufile the word is ACTIONS, while in the toolbar files it's ACTION - go figure).
If you still think that Menufiles is way to go for your situation, you will need to replace your Macro(s) with Journal files, as they are supported.
Now, if for nothing else than perhaps for the irony value, it turns out that if you would have been able to use customized Roles, as I initially suggested, instead of Menufiles, there's NO problem whatsoever with adding a new 'button' to the NX interface (in either a menu or a toolbar), using the Customize function, which when selected would cause your MACRO to execute. What can I say?
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: How to run a *.macro file from the menu file (*.men)?
Thank you a lot for your comprehensive answer. It is very helpful for me. In my case I have to change Macros to Journal files.
RE: How to run a *.macro file from the menu file (*.men)?
Like this...
So in the .tbr-file
BUTTON my_button
LABEL My Button
BITMAP my_button.bmp
ACTIONS ${NX_CUSTOM_DIR}\global\automation\macro\application\my_button.macro
and in the .menu file
BUTTON my_button
LABEL My Button
BITMAP my_button.bmp