Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

API of return to model from CAE post

Dear all,After show fringe of result,I can return to show model by click "return to model" button.But this function don't support journal,I want to know the API of this function.

4 REPLIES

Re: API of return to model from CAE post

 

If you cannot record the action in a Journal, it is possible that there is no API for that yet.

 

But if you are running NX10, you could try switching to the modeling application with the ApplicationSwitchImmediate() method, which is part of the Session class.  (I have not tested this in the situation that you described.)

Solution
Solution
Accepted by topic author ship_cheng
‎11-21-2015 02:17 AM

Re: API of return to model from CAE post

You need to delete the PostView to return to the model. If you have created the postview in your code, you should have the postview ID that was assigned on creation. Use Session.Post.PostviewDelete() to delete it.

 

The following python code will blindly delete all post views that exist:

 

import NXOpen

theSession = NXOpen.Session.GetSession()
theLw = theSession.ListingWindow

def main(): 

    theLw.Open()

    for postId in theSession.Post.GetPostviewIds():

        theLw.WriteLine("Closing Postview ID: " + str(postId))
        theSession.Post.PostviewDelete(postId)

# Main program.

if __name__ == "__main__":
    main()

Re: API of return to model from CAE post

Thank you,this method work fine.

Re: API of return to model from CAE post

Thank you too!