ListingWindow Class

class NXOpen.ListingWindow

Bases: object

Represents a ListingWindow.

To obtain an instance of this class, refer to NXOpen.Session

New in version NX3.0.0.

Properties

Property Description
Device Returns the device type for the window.
IsOpen Returns a flag indicating whether the listing window is open.

Methods

Method Description
Close Closes the stream to the listing window.
CloseWindow Closes the listing window actually from the UI.
Open Opens the listing window.
SelectDevice Changes where the listing window output is sent.
WriteFullline Writes a full line to the listing window.
WriteLine Writes a line to the listing window.

Enumerations

ListingWindowDeviceType Enumeration Describes the type of listing window

Property Detail

Device

ListingWindow.Device

Returns the device type for the window.

The device type indicates whether the output for the listing window is sent to the Information window, to a file, or to both

-------------------------------------

Getter Method

Signature Device

Returns:
Return type:NXOpen.ListingWindowDeviceType

New in version NX3.0.0.

License requirements: None.

IsOpen

ListingWindow.IsOpen

Returns a flag indicating whether the listing window is open.

To open the window, use NXOpen.Arc.

-------------------------------------

Getter Method

Signature IsOpen

Returns:
Return type:bool

New in version NX3.0.0.

License requirements: None.

Method Detail

Close

ListingWindow.Close

Closes the stream to the listing window.

The window itself is not closed. If the listing window is a file, this will flush the buffer and close the file.

Signature Close()

New in version NX3.0.0.

License requirements: None.

CloseWindow

ListingWindow.CloseWindow

Closes the listing window actually from the UI.

Signature CloseWindow()

New in version NX6.0.0.

License requirements: None.

Open

ListingWindow.Open

Opens the listing window.

The listing window must be open before lines can be written to it

Signature Open()

New in version NX3.0.0.

License requirements: None.

SelectDevice

ListingWindow.SelectDevice

Changes where the listing window output is sent.

The listing window output can be sent to the Information window of the Unigraphics session, to a file, or to both.

Note: file output is buffered. If file output is used, the buffer will not be flushed until the output device is changed again. E.g.

ListingWindow.SelectDevice(File, “log.txt”) ListingWindow.Open() ListingWindow.WriteLine(“output”) ListingWindow.Close() ‘ buffer is not flushed yet ListingWindow.SelectDevice(Window, “”) ‘ now the buffer is flushed

Signature SelectDevice(deviceType, fileName)

Parameters:
  • deviceType (NXOpen.ListingWindowDeviceType) – The type of device (file, Information window, or both)
  • fileName (str) – Name of the file. Used only if the device type is file.

New in version NX3.0.0.

License requirements: None.

WriteFullline

ListingWindow.WriteFullline

Writes a full line to the listing window.

The listing window must be open before you can write to it. If the listing window is a file, the output is buffered, so the output may not appear in the file until the buffer gets flushed. The buffer is flushed when the listing window gets closed. And number of characters displayed in one line has no limit which is different from NXOpen.ListingWindow.WriteLine()

If None is passed in this method will do nothing.

Signature WriteFullline(msg)

Parameters:msg (str) – Line to write

New in version NX8.5.0.

License requirements: None.

WriteLine

ListingWindow.WriteLine

Writes a line to the listing window.

The listing window must be open before you can write to it. If the listing window is a file, the output is buffered, so the output may not appear in the file until the buffer gets flushed. The buffer is flushed when the listing window gets closed. And the maximum number of characters displayed in one line is 132.

If None is passed in this method will do nothing.

Signature WriteLine(msg)

Parameters:msg (str) – Line to write

New in version NX3.0.0.

License requirements: None.