Showing results for 
Search instead for 
Do you mean 
Reply

UF_UI_update_listing_window has no effect in NX11

I am updating and compiling some of our automation code to NX11

 

A small program that will loop through the selected CAM objects and generate out of date operations.

 

Before generating the operation it prints Operation name after it print success or error.

 

Was working fine NX4 to NX9 (I have not tested NX10)

 

In NX11 no information is displayed until the program completes.

 

I will submit this to support, was wondering if anyone might have a work around?

 

Extract of code here:

 

logical GenerateOp(tag_t optag, void *data)
{    
    logical isGroup;
    char name[UF_OPER_MAX_NAME_LEN + 1];
    char msg[133];
    static int cnt=0;

    UF_NCGROUP_is_group(optag, &isGroup);
    if(!isGroup)
    {
        
        UF_OPER_status_t operStatus;
        UF_OPER_ask_status(optag, &operStatus);
        UF_OBJ_ask_name(optag, name);
        sprintf(msg,"Operation %4d %-32s...", ++cnt, name);
        UF_UI_write_listing_window(msg);
        UF_UI_update_listing_window();
        if(operStatus.is_edited)
        {
            int irc;
            char err[133];
            logical gened;
            irc =  UF_PARAM_generate(optag, &gened);
            if(gened)
            {
                UF_UI_write_listing_window("OK\n");
            }
            else
            {
                UF_get_fail_message(irc, err);
                sprintf(msg, "%s\n", err);
                UF_UI_write_listing_window(msg);
            }
        }
        else
        {
            UF_UI_write_listing_window("Not Edited\n");
        }
	UF_UI_update_listing_window();
    }
    return TRUE;
}
11 REPLIES

Re: UF_UI_update_listing_window has no effect in NX11

Try to use the new API class for ListingWindows. The class Name is ListingWindow in C++

Re: UF_UI_update_listing_window has no effect in NX11

Even with ListingWindow.WriteLine, the output is not imediate. When I run a similar program in NX 9, 10, and 11, the window is not refreshed until the program ends. From the documentation:

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 a null reference (Nothing in Visual Basic) is passed in this method will do nothing.
Created in NX3.0.0

 

I tried to update by reselecting the device, but no luck. Maybe somebody has a trick?

theSession.ListingWindow.Open()
theSession.ListingWindow.WriteLine(camObject.Name() & " is subtype " & operationSubtype)
theSession.ListingWindow.SelectDevice(ListingWindow.DeviceType.Window, " ") 

 

Mark Rief
Retired Siemens

Re: UF_UI_update_listing_window has no effect in NX11

My guess is that this functionality was broken when the enhancements for HTML formatted list window output were added in NX 11. I would suggest opening a call with GTAC to report and verify.

Re: UF_UI_update_listing_window has no effect in NX11

IR 7897406: regression - UF_UI_update_listing_window has no effect in NX11

Re: UF_UI_update_listing_window has no effect in NX11

For what its worth VB journal does the same.

 

works fine NX9 & 10.

 

No output to listing window in NX11 until Journal completes 

 

Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Utilities

Module Listing

    Dim theSession As Session
    Dim theUfSession As UFSession
	
    Sub Main()

        theSession = Session.GetSession()
        theUfSession = UFSession.GetUFSession()
        Dim WorkPart As Part = TheSession.Parts.Work
		theSession.ListingWindow().Open		
		
		For index as integer = 1 to 25
			Dim output As String = "Message  " & index
			theSession.ListingWindow().Open
			theSession.ListingWindow().WriteLine(output)
			theSession.ListingWindow().Close
			Threading.Thread.Sleep(100)
		Next
		theSession.ListingWindow().Open
    End Sub

End Module

Or change the code in the loop to use the wrapped function Ui.UpdateListingWindow()

 

Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Utilities

Module Listing

    Dim theSession As Session
    Dim theUfSession As UFSession
	
    Sub Main()

        theSession = Session.GetSession()
        theUfSession = UFSession.GetUFSession()
        Dim WorkPart As Part = TheSession.Parts.Work
		theSession.ListingWindow().Open		
		
		For index as integer = 1 to 25
			Dim output As String = "Message  " & index
			theSession.ListingWindow().WriteLine(output)
			theUfSession.Ui.UpdateListingWindow()
			Threading.Thread.Sleep(100)
		Next
		theSession.ListingWindow().Open
    End Sub

End Module

 

 

Re: UF_UI_update_listing_window has no effect in NX11

Thanks for reminding me about the wrapper - 

theUfSession.Ui.UpdateListingWindow()

I confirmed this does not work in NX 11. I'll check on the IR. Maybe we can add 

theSession.ListingWindow().Update

 

Mark Rief
Retired Siemens

Re: UF_UI_update_listing_window has no effect in NX11

The change to HTML is surly a problem, since HTML pages must follow a defined scheme.

An ASCII text display can be updated at any stage.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: UF_UI_update_listing_window has no effect in NX11

IR updated to PR 7897406 Priority 1

Re: UF_UI_update_listing_window has no effect in NX11

FYI the problem with UF_UI_update_listing_window is fixed in NX 11.0.2 and NX 12.

Mark Rief
Retired Siemens