cancel
Showing results for 
Search instead for 
Did you mean: 

Listing device auto scroll

In my post if I use the "MOM_output_to_listing_device" procedure it puts it at the 1st line of the listing file, but when the program is done being posted it scrolls to the first line in the program.  With this behavor the user would have to scroll up to the top and check for error messages.  Is there a way I can have it go back up to the very top of the output, above the top of the program?

Jake Hardwick
CNC Programmer
Senior Aerospace AMT
Production NX8.5.3.3 Beta testing NX10.0.1.4
6 REPLIES

Re: Listing device auto scroll

Esteemed Contributor
Esteemed Contributor

Yes, this is an annoyance.

 

Personally, I (almost) NEVER list the posted code to the info window.  Instead, I compare the previous & current versions of the posted code in a comparison utility like CompareIt! or Winmerge or any of a dozen other programs. (so I can see what did, or did not, change)

 

Most of the users i support do not do this, so I have contemplated re-writing all my "MOM_output_to_listing_device" errors/warnings to a separate tcl/TK dialog, so they show up in a separate window.

 

Still looking for a better way.

 

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Listing device auto scroll

Ken,

 

I stopped the program code from getting output to the listing window and got a bunch of calls from programmers asking me why the post was broke (even though it clearly stated "your programs was posted without any errors to **insert file path here**)  

 

Your comment about using another program to asses the code brings up another question I have.

 

I tried to get the post to output my code and open it with cimco, notepad++, winmerge or something like that. Every time it completed posting the external text editing program would open with my file, but it would hang NX and force you to close it through task manager.

 

Here is the code I was using (It's been through a lot of iterations in my effort to debug)

 

#=============================================================
proc PB_CMD_AMT_combine_files { } {
#=============================================================
#Combines the header and the main body of program together

global header_output_name final
global mom_output_file_full_name mom_output_file_basename mom_output_file_directory mom_output_file_suffix
global fl fin finn filearr line dump


MOM_open_output_file $mom_output_file_full_name
MOM_close_output_file $final


set fin 0

set fin [open "$header_output_name" r]
    while {[gets $fin line] >= 0} {
            MOM_output_literal "$line"
          }
close $fin

set fin [open "$final" r]
    while {[gets $fin line] >= 0} {
            MOM_output_literal "$line"
          }
close $fin

file delete -force "$final" "$header_output_name"
MOM_close_output_file $mom_output_file_full_name


[exec "C:\\CIMCO\\CIMCOEdit6\\CIMCOEdit.exe" "$mom_output_file_full_name"]


MOM_output_to_listing_device "YOUR PROGRAM WAS POSTED WITHOUT ERRORS TO $mom_output_file_full_name"

}

 

Jake Hardwick
CNC Programmer
Senior Aerospace AMT
Production NX8.5.3.3 Beta testing NX10.0.1.4

Re: Listing device auto scroll

Esteemed Contributor
Esteemed Contributor

I use the method in pb_cmd_ugwish_win64.tcl (just like if I were using a TK dialog)

But deal with the return file RIGHT AWAY, before running the "exec" command:

 

	set fid [open "$tmp_file" w]

	# Do this right away in case "exec" hangs
	puts $fid "junk"
	close $fid
	file attributes "$tmp_file" -readonly 1

	
	# NOW use compare utility
	exec "$compare_exe" "$file1" "$file2"

 Note this leaves the EXE running while returning control to NX

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Listing device auto scroll

Phenom
Phenom

I have had a lot of problems doing this every way I have tried to. The best luck I have had was creating a VB app that launches an editor and watch NX process activity. So - I have no solution. This worked almost every time - and is still in production at one facility. I hear about someone having to kill it a couple times a year. I have also tried the open command. This is the code that executes the "launch" app with command line params.

 

proc MOM__halt {} {
  global mom_output_file_full_name
  MOM_close_output_file $mom_output_file_full_name
  set mydir [MOM_ask_env_var UGII_CAM_CUSTOM_DIR]
  append mydir "common_source\\application\\editor"
  set myexpath $mydir
  regsub -all {\B} $myexpath "/" myexpath
  append myexpath "/launch.exe"
  eval [list "exec" "$myexpath" "$mom_output_file_full_name" "|$mydir" "&"]
}

 Ken's looks better. I will have to try that.

 

NX10.03
Windows 7 Pro

Re: Listing device auto scroll

Builder
Builder
I created a procedure that stores error messages. You call the procedure and pass the error message. At the end of the program if any error messages are present I output those to the listing device, and delete the program.

Re: Listing device auto scroll

Esteemed Contributor
Esteemed Contributor

I use the following line in my shop docs Tcl code to show the resulting text file.

The ampersand at the end instructs Tcl to run the new process separately.

 

exec "notepad.exe" "${JH_output_file_full_name}" &

 

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: NX12.0

How to Get the Most from Your Signature in the Community

Learn online





Solution Information