×
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

Run a macro from a .men file

Run a macro from a .men file

Run a macro from a .men file

(OP)
I am trying to write my own .men file to create a command to run a macro. I have run into the same problem as this thread thread561-94732: .tbr files. Is there anyway to do this?

I know you can do this by customising the menus in NX but I would like to write a .men file to easily share between uses over a network rather than each user creating the command in NX.

NX6.0.1.5, TC2007

RE: Run a macro from a .men file

In a .tbr file the line that includes the path to the macro starts with:

ACTION

In a .men file, it starts with:

ACTIONS

John R. Baker, P.E.
Product 'Evangelist'
NX Design
Siemens PLM Software Inc.
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: Run a macro from a .men file

(OP)
John,

I have tried to use ACTIONS as below:

  BUTTON TX_DRAFT_DIM_HOLE
  LABEL Ho&le...
  MESSAGE Creates a single leader diameter dimension for a circular feature.
  SYNONYMS diameter, radius
  HELP DRF_DIM_HOLE
  BITMAP hole_dim
  ACTIONS $UGII_SITE_DIR\DiaDim.macro

But get the error message:

"None of the actions specified for this button were registered Use Information->Custom Menubar->Report Tool for more information"


I did this and in the report found this:

Item     TX_DRAFT_DIM_HOLE                        Hole...                                 
 Actions:
  <actions not registered>

Not sure whats going on?

NX6.0.1.5, TC 2007

RE: Run a macro from a .men file

Try replacing the name of the entry after BUTTON with a valid function (anything should work since it's just a placeholder).

John R. Baker, P.E.
Product 'Evangelist'
NX Design
Siemens PLM Software Inc.
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: Run a macro from a .men file

(OP)
I tried

BUTTON UG_DRAFT_DIM_HOLE

and the button no longer showed up on the menu. I then tried

BUTTON UG_APP_MODELING

The button showed up but the icon and help message has changed to the "application modeling" button and the button now does nothing.

I'm not sure exactly what you mean by "Try replacing the name of the entry after BUTTON with a valid function". I have created other custom menu buttons that call up .vb files and they run fine eg.

  BUTTON INSERT_MATERIAL_NOTE
  LABEL Insert &Material Note
  MESSAGE Inserts standard Material note.
  ACTIONS run_journal $UGII_SITE_DIR\InsertMaterialNote.vb

RE: Run a macro from a .men file

(OP)
The only way I have managed to get this to work is to define the custom button in a .tbr file first ie

  BUTTON TX_DRAFT_DIM_HOLE
  LABEL Ho&le...
  MESSAGE Creates a single leader diameter dimension for a circular feature.
  BITMAP hole_dim
  ACTION $UGII_SITE_DIR\DiaDim.macro

And then call this button in the .men file ie

  BUTTON TX_DRAFT_DIM_HOLE

Is there a bug with setting up macros in .men files?

RE: Run a macro from a .men file

Perhaps, but I think it's a bit more of a Catch 22 since at one time, you couldn't add anything to a toolbar that didn't already exist somewhere on a drop-down menu.  Of course that didn't go over too well so changes were made, but I suspect that there are still some 'links' between the menu code and the toolbar code which can create some problems under the right conditions.

However, that being said, it may still be worth it for you to contact GTAC and have them take a closer look at this.

John R. Baker, P.E.
Product 'Evangelist'
NX Design
Siemens PLM Software Inc.
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.
 

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