×
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 NX command using API

Run NX command using API

Run NX command using API

(OP)
Hi,

I am currently developing a solution where I need to run some standard NX commands using API calls. Is it possible?

Kindly advise. I am using NX 9.0

Thanks
Rajat Jain

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

RE: Run NX command using API

Are you talking about running these "NX commands" from within the NX session itself or as part of a purely external program?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: Run NX command using API

(OP)
Hi John,

Let me describe the scenario here.

I have an addin which has an associated menu. When the user clicks on the menu command, we call a function, say f1(). This function does many processes which are internal to the addin. The function also calls native NX command (like Add Component) in its process. This call should be as good as a user clicks on the Add Component command from NX Menu.

How do we call the Native NX command using API?

I hope it explains the situation.

Kindly advise.

Thanks

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

RE: Run NX command using API

I'd start by recording a journal and studying the output code.

In Preferences -> user interface -> journal, choose your language of choice. Start the journal recorder, perform a simple operation, stop the recorder, open the resulting file in a text editor. Some operations cannot be 'recorded' in this fashion, but many can.

www.nxjournaling.com

RE: Run NX command using API

(OP)
Hi cowski,

Thanks for your reply.

I tried this approach earlier. The Journal recorder records the functions which are used internally by the command but it does not give the command interface.

I am looking for a direct call to command through a commandManager type object.

Hope it defines the problem.

Thanks

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

RE: Run NX command using API

(OP)
Any ideas on how to run Native NX command using NX APIs?

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

RE: Run NX command using API

When you say "Native NX command", do you mean using the NX API to open native NX dialogs like "Add Component" and let the user work with them (as opposed to actually adding the component with an appropriate API function)?

RE: Run NX command using API

(OP)
Hi,

Yes, I want to run the Native NX command (which is executed when the Menu button is pressed). The Native NX command run should automatically pop the corresponding UI.

Any help is appreciated!!!

Thanks for your help!!!

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

RE: Run NX command using API

Well, there's good news and bad news. The (sort-of) good news is that there is the UF_UI C API library that allows you to call several built-in dialogs like File-New (UF_UI_create_part) or File-Open (UF_UI_open_part), as well as some feature selection and file selection dialogs (I'm sure the other APIs have similar functions, like NXOpen.FileNew etc). The bad news is that the "Add Component" dialog specifically is not among them, meaning that if you want to let users add components to their assemblies via a dialog window you have to do the following:

1) Either construct the dialog yourself with Block UI Styler (complicated, since you'll also have to implement the subsequent Constraints dialog);
2) Or call a macro file from your program that clicks the necessary button (also complicated and mostly futile, since macros are very environment-dependent, not to mention obsolete);
3) Or complain to Siemens PLM until they implement the missing function (good luck with that).

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