×
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 Macro through NX API

Run Macro through NX API

Run Macro through NX API

(OP)
Hi,

Is there a method to call a NX macro through NX addin using NX API?

I am working on NX9.0.

Kindly advise.

Thanks

Rajat Jain
Technical Director
JeeneDo Auto-Configure Pvt. Ltd.
www.auto-configure.com

RE: Run Macro through NX API

Rajatjain,

No, (not in the same NX session as the api program - hypothetically the journal could create a new process that launched another NX session with the command line option to execute a macro upon NX startup - but that has very limited usefulness).

I do not think that is worth pursuing. What operations are causing you to consider using macro?

The opposite workflow is possible - the macro can launch the api program. Can you perform the macro operations before invoking the api program?

Regards, Joe

RE: Run Macro through NX API

@Rajatjain: Yes, you can do this with the undocumented function "MACRO_playback_from_usertool" from libugui.dll, which you can access using UF_load_library. UF_load_library will give you a function pointer which you can then invoke with the name of your macro as the argument. It's rather complicated and should be only used as a last resort (i.e. you absolutely must do this and there's no way to get around it), because, well, it's an undocumented function! You never know if the NX devs throw it out in the next version, or make you PC spontaneously combust, or something.

@jpetach: The question is probably a follow up to this one, meaning that Rajatjain is trying to open the "Add Component" dialog with the API.

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