Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Output Notes in NC program

Genius
Genius

I was under the impression that MOM_cycle_objects does not pertain to postprocessors, but is for use in Shop Docs to cycle through the different manufacturing views. I may be wrong but what you have going on is weird to say the least.

Mike Diamond, CNC Programmer, Orizon Aerostructures Inc.

Production: NX10.0.3.5, Vericut 8.1.4, ICAM V21
Development: VB.NET, Tcl/Tk
Testing: NX12

Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thanks, Diamond.

 

This is a DMU80_eVo_iTNC post.

 

Kai

Re: Output Notes in NC program

Phenom
Phenom

Are you writing a tool list? That is one way I have seen it used. The tcl of the post probably sources another tcl that has the MOM_cycle_objects in it. Look for "source" in the tcl to see what other files may be involved..

NX12.02
Windows 10 Pro

Re: Output Notes in NC program

Phenom
Phenom

MOM_do_template_file may be the culprit. I don't remember exactly what it does (not at work pc now) but it is related to shop docs I think. It that there are probably MOM_cycle_objects from that to cause this.

NX12.02
Windows 10 Pro

Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thanks, Study. You are right. It is sourcing a file called "simulation_msc.tcl", in which there is MOM_cycle_objects. 

 

The file is sourced at the end of the post:

 

set cam_post_user_tcl "simulation_mcs.tcl"


#***************************
# Source in user's tcl file.
#***************************
set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
set ugii_version [string trimleft [MOM_ask_env_var UGII_VERSION] v]

if { [catch {
   if { $ugii_version >= 5 } {
      if { [file exists "[file dirname [info script]]/$cam_post_user_tcl"] } {
        # From directory relative to that of current post
         source "[file dirname [info script]]/$cam_post_user_tcl"
      } elseif { [file exists "${cam_post_dir}$cam_post_user_tcl"] } {
        # From directory relative to UGII_CAM_POST_DIR
         source "${cam_post_dir}$cam_post_user_tcl"
      } elseif { [file exists "$cam_post_user_tcl"] } {
        # From the specified directory
         source "$cam_post_user_tcl"
      } else {
         MOM_output_to_listing_device "User's Tcl: $cam_post_user_tcl not found!"
      }
   } else {
      if { [file exists "${cam_post_dir}$cam_post_user_tcl"] } {
         source "${cam_post_dir}$cam_post_user_tcl"
      } else {
         MOM_output_to_listing_device "User's Tcl: ${cam_post_dir}$cam_post_user_tcl not found!"
      }
   }
} err] } {
   MOM_output_to_listing_device "User's Tcl: An error occured while sourcing $cam_post_user_tcl!\n$err"
   MOM_abort "User's Tcl: An error occured while sourcing $cam_post_user_tcl!\n$err"
}

 

I am wondering why there is problem in notes when MOM_cycle_objects is used.

 

Regards,

Kai

Re: Output Notes in NC program

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The problem is that (in general) the post does NOT "clean up" after itself.

So when you run MOM_cycle_objects, that encounters the operation with the notes.  So all the note variables get defined.  But nothing "unsets" those variables after the MOM_cycle_objects.  So when you get (in the post) to the place where you test for & output operation notes, those variables still exist.  So they get output.  And THEN "cleaned up".

 

What I would suggest you do.

1) Find the "Moog_Show_Globals" proc I posted (a whhile ago) on this forum.

2) Add it just before & just after the thing that calls MOM_cycle_objects

- add before, run post, save the "info" window to a text file

- move it after,  run post, save the "info" window to a (different) text file

3) Compare the "before" to the "after" output files to see what changed.

4) Add your own code after the MOM_cycle_objects call, to do something with the variables that got changed.

- if variable added, just delete it (I would suggest "catch { unset variable_name}"

- if variable changed value, I would suggest some code to save the old value before the MOM_cycle_objects call & restore it after.  This gets "interesting" if the variable is an array.  Note for some changed variables you may be able to just unset them & the post will re-define before you need them.

 

Good luck!

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


Re: Output Notes in NC program

Valued Contributor
Valued Contributor

Thank you very much, Ken. Prolem solved!

 

Kai

Learn online





Solution Information