NX API Getting Started : How do I find out what NXOpen class or method I need

NX API Getting Started : How do I find out what NXOpen class or method I need

Record a journal of the interactive steps that you want to automate.

If you are trying to find out what class/method/property to use to access a 
piece of information such as a value, try recording a journal of the 
interactive steps that you would use to CHANGE that value rather than the 
steps you would use to see it.  If a Builder class is used to Set it, then the
same Builder will be used to Get it.

If you do not know what the interactive steps are then you need to find that
out first.  You cannot write an application to do something that you do not
know how to do.  (Unless of course you get lucky and can find a sample here.)

1)  Record the journal

    Use Preferences-> User Interface-> Journal and set your journal language 
    to either Visual Basic or C#

    Turn on Tools-> Journal-> Record

    Perform the steps that you want to automate (use F1 to see the interactive
    documentation as needed)

    Tools-> Journal-> Stop

    Undo (or Close and Reopen the part) to get it back to the same state it 
    was in when the journal record was started

    Tools-> Journal-> Play to Run the vb or cs journal 

    Did it work?  If so it now contains code you can use.

2)  OPTIONAL:  Strip out the unneeded UI artifacts
    Do this if you cannot stand having extratraneous stuff in your code.
    Otherwise it is perfectly fine to just leave it.

    Save the journal

    Undo
    
    Cut out any lines which you think you do not really need, e.g. creating and
    deleting multiple Undo marks.  Do not delete a line which calls Destroy on
    a Builder class!  These are important.

    Play

    Did it still work?  Loop back to 2) as desired.

3)  OPTIONAL:  Translate the journal to your comfortable or mandated language
    Do this if you prefer (or have been told to) use Java or C++.

    Undo

    Use Preferences-> User Interface-> Journal and set your journal language
    of choice (C++ or Java)

    Turn on Tools-> Journal-> Record

    Tools-> Journal-> Play to Run the vb or cs journal

    Tools-> Journal-> Stop

You now should have validated source which accomplishes your desired steps.
    • Related Articles

    • NX API Getting Started : Adding your own UI to remove journal selection stickiness

      When you record a journal the generated code contains hard-coded references to any NX objects that you selected rather than code which would put up the UI to have the end user do the selection. This is by design and we refer to it as "Selection ...
    • Operating System and 3rd party Certifications

      Please click below links to find out the operating system that are compatible for each of the Siemens PLM Software. .................................................................................................................................. ...
    • NX CAE - Customized Application Using NX Open

      Hi, Please find the youtube video link below which demonstrate this application. http://www.youtube.com/watch?v=3I0fKw2QbWE&feature=youtu.be Please check on the attached data if you are interested to use the customed app in this video. Cheers, Tuw
    • How to add a NX Custom Template

      The demonstration video below is related to NX CAE Application: https://www.youtube.com/watch?v=2PURAUxsJmY&feature=youtu.be For information on how to set the custom template location, please click here. Cheers, Tuw
    • NX CAE - Restart Analysis Using Sol601,106

      Hi, In CAE, restart analysis means that the analysis that is stopped by the solver previously, whether by error or by normal termination, is continued again to achieve certain purposes, without starting from the beginning of the analysis. Benefits of ...