×
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

How to run a *.macro file from the menu file (*.men)?

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

RE: How to run a *.macro file from the menu file (*.men)?

Is there any particular reason why you are using Menufiles rather than using Customize, then saving a Role which can be shared with others?

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)?

(OP)
John,

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)?

Have you tried replacing the '$UGII_GROUP_DIR' with the actual full path just to make sure that it works?

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)?

(OP)
John,

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)?

OK, after trying this myself and even replacing the Macro with a GRIP program just to make sure that the menufile was actually being properly recognized (which it was), I decided to go back and read the documentation in a little more detail and low & behold, I uncovered something that I honestly was NOT aware of, which I've since had confirmed by the development leader responsible for this area of NX, because I was a bit amazed myself.

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)?

(OP)
John,

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)?

If you want to have the .macro in the menu. You have to define the action in a toolbar file

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

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