Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm sure this used to work....didn't it?

Befuddled

Aerospace
Jan 9, 2008
75
All,

I was creating a short bit of code to cycle through some stuff and report to the listing window as it went..... but it only seems to display the data in the listing window after execution... not dynamically...

The grey matter is recalling something about the move to HTML (but its too grey and old)

Using NX1973 if that makes a difference?

Is it possible to make NX report to a window dynamically?

Cheers in advance B.



simple bit of code to prove it:-
'--------------------------------------------------------------------------
Option Strict Off
Imports System
Imports NXOpen
Imports nxopen.uf

Module display_count

Sub Main (ByVal args() As String)

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
Dim theUFSession As UFSession = UFSession.GetUFSession()
Dim theUI As UI = UI.GetUI()
Dim theUISession As UI = UI.GetUI
Dim ItemCnt as integer
Dim LW As ListingWindow = theSession.ListingWindow

lw.Open()
Dim num as integer = 1
Do Until num = 10
lw.WriteLine("Item " & num.ToString())
num = num +1
Loop

lw.close()
End Sub


'-------------------------------------------
' > function to exit and clean up
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
End Function

End Module
 
Replies continue below

Recommended for you

There is the "UpdateListingWindow" method. Per the NX help docs:
Overview
This function forces the listing window to redisplay to show all
text that has been written to it. Long operations can use this to show
progress by writing to the listing window and periodically forcing an
update. However the update itself takes time so should only be done when
necessary as otherwise performance can suffer.
 
Thanks,

Just tried it... wow that really impacts the performance.

if i find neat fix, i'll post it.

Cheers,

B
 

Part and Inventory Search

Sponsor