Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Modifing the CLS output for angle heads

Phenom
Phenom

Are you able to open the cl post that icam ships? Maybe they already flip the kin variable and have a good starting point.

NX12.02
Windows 10 Pro
ITC Inc.

Re: Modifing the CLS output for angle heads

Valued Contributor
Valued Contributor

Yes I can open the ICAM version but it works the same as the NX version.

Re: Modifing the CLS output for angle heads

Phenom
Phenom

In that case - it may be easiest to let the file get written and as a last step - go through it line by line and redo the GOTO's. You can do this by creating a "MOM__halt" proc - open the file in it line by line - and replace them when writing it out. You would have to write the info you need for the calculation in the file (gage length or whatever.)

NX12.02
Windows 10 Pro
ITC Inc.

Re: Modifing the CLS output for angle heads

Valued Contributor
Valued Contributor

I would not have thought of creating a MOM_Halt to do this. As it happens the last thing in any of my post and I added it to my CLS Generator was a Rename proc where I close the output file and rename it to a standardized naming format. I was just going to add to it, to run the output file thru a Visual Basic program to go thru it line by line and fix the needed areas. Would there be an advantage to use the MOM_Halt proc or would the result be the same either way?

Re: Modifing the CLS output for angle heads

Phenom
Phenom

Same result I would think. If you are already running an exe - that is just as good. As you probably know - the MOM__halt is done as the last event during posting. It is after MOM_end_of_program. Even sync posting which makes multiple passes while posting only fires one MOM__halt at the end. You still have to close the output file first. The code is something like this:

 

proc MOM__halt {} {

 

global mom_output_file_full_name
MOM_close_output_file $mom_output_file_full_name

set fin [open "$mom_output_file_full_name" r]

set fout [open "$mom_output_file_full_name\2" w]
while {[gets $fin line] >= 0} {
if {[string first $line "GOTO"] > 0} {

  ... do parsing - rewrite as newline

  puts $fout $newline

} else {

  puts $fout $line
}

}
close $fin

close $fout

 

}

NX12.02
Windows 10 Pro
ITC Inc.

Learn online





Solution Information