Showing results for 
Search instead for 
Do you mean 
Reply

NXOpen Python export PNG or Results from CAE BATCH modus

Hi,

 

is there a way in NX to export Stress and Temperature results from NX Advanced Simulation Post View screen.

I would like to use NXOpen to open a simulation file, open the result, plot the stress and export this as png or any picture format.

But this should all happen in batch modus. But you cant journal export png, and if you export PDF it is only a wireframe.

Can you somehow render the results in batch modus and export this? Like in Ansys with Apdl code?

 

Regards,

Behnam Nouri

Siemens LGT

11 REPLIES

Re: NXOpen Python export PNG or Results from CAE BATCH modus

[ Edited ]

@BehNouri,

 

You can use the open C function UF_DISP_create_image() to export a PNG/JPEG/TIFF/GIF/XWD/BMP image file of the post display.

 

Python wrapper documentation: NXOpen.UF.Disp.CreateImage

 

 

 

 

Re: NXOpen Python export PNG or Results from CAE BATCH modus

But please note that UF_DISP_create_image() (or the wrapper) is only available in an internal environment.  You will not be able to use it in batch mode.

 

Re: NXOpen Python export PNG or Results from CAE BATCH modus

[ Edited ]

Hi yes you cannot journal it and use it in batch modus.

But is there any way to export pictures out of NX?

Cant NX create a display environment in batch modus? Does NX not have an own software renderer? You dont need graphic card to render an image.


Regards,

Behnam

Re: NXOpen Python export PNG or Results from CAE BATCH modus

Hello Steve,

 

I'm having the same request: to be able to make screenshot in batch mode.

Is there an option to run a batch with Graphical User Interface?

 

Abaqus for example allows the user to specify whether to run scripts with or without GUI. Without GUI is much faster, but does not allow graphical functionality.

 

Regards,

Frederik

Re: NXOpen Python export PNG or Results from CAE BATCH modus

Frederik,

 

Good morning.  NX also runs with or without a graphical user interface.  There are a few API calls that are specified in the docs to only work in the interactive mode - meaning that there is a GUI displayed.  Selection calls fall into this category, and some of the display calls, (including UF_DISP_create_image) fall into this category. 

 

Best regards,

 

Steve

 

 

 

Re: NXOpen Python export PNG or Results from CAE BATCH modus

Hello Steve,

Thank you for your answer.
One thing is not entirely clear yet to me: Can I start NX in the batch mode AND have the GUI start up (similar to the default behavior of Ideas)?

Regards,
Frederik

Re: NXOpen Python export PNG or Results from CAE BATCH modus

Can we have this in a wishlist for future NX version.

Be able to create post processing pictures in Batch modus.

Like Abaqus and Ansys post processing.

For automation and optimizitaion this is quite important.


Regards,

Behnam

Re: NXOpen Python export PNG or Results from CAE BATCH modus

Frederik,

 

I'm sorry that was not clear.  Perhaps the best thing I can do to answer that is to quote from the NX documentation, under NX Open -> NX Open Programmer's Guide -> Executing NX Open Automation -> Execution Modes:

 

NX Open applications may be executed in three different modes. The following tables defines the differences between the execution modes.

 

Interactive (a.k.a. internal)

 

In this mode the application is running as part of an NX interactive session. The NX display window, menus, toolbars and resource tabs are active. The application may present its own set of dialogs to the user or the application may run behind the scenes. The application may perform a wide range of activities from geometry generation to design rule validation.

 

Batch (a.k.a. external)

 

In this mode the application runs without an NX interactive user interface. The application has full access to NX part models but no NX display options may be executed. Any user interface has to be provided by the application. Batch applications are typically used for time consuming tasks that require little human interaction.

 

Remote

 

In this mode their is a client and server application. The client and server execute as separate processes. The client and server may or may not reside on the same machine. The client or the server may work with NX in an interactive or batch mode. Communication between the client and server is via remote procedure calls (supported directly by Java and .NET) or by some other inter-process communications (e.g. COM objects, ports). Remote applications are useful when there is some sort of central data or knowledge that has to be shared by multiple sites.

 

I hope that helps!

 

Best regards,

 

Steve

Re: NXOpen Python export PNG or Results from CAE BATCH modus

This is probably more complex than what you need but you could take your stress/temperature results and output them via the Python library matplotlib.

 

http://matplotlib.org/gallery.html

 

Then just save the resulting plot in whatever format you need.