Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Run Macro through NX API

Status
Not open for further replies.

rajatjain

Computer
Aug 7, 2013
11
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.
 
Replies continue below

Recommended for you

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
 
@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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor