Showing results for 
Search instead for 
Do you mean 
Reply

TCL : Mom_pprint

hello ,

 

I have an operation , and i use  UDE :

PPRINT/MESSAGE 1

PPRINT/MESSAGE 2

 

i have two problems
the first problem : i would like to insert a message when variable MOM_pprint doesn't exist.

 

my code :

#=============================================================================
proc MOM_pprint {} {
#=============================================================================
  global mom_pprint
  global mom_pprint_defined
  
  
     if {![info exists mom_pprint_defined]  } {
        MOM_output_literal "PPRINT/no message !!!"
}
}

 unfortunately , I have nothing appears

I turn on the review tool and i don't see variables mom_pprint_defined or mom_pprint  

any idea ?

 

 

Second problem : i would like display my 2 PPRINT on the same line , like this : PPRINT/ MESSAGE 1 ; MESSAGE 2

 

thanks for the help

 

NX8.5

 

@mkn
9 REPLIES

Re: TCL : Mom_pprint


mkn wrote:

hello ,

 

I have an operation , and i use  UDE :

PPRINT/MESSAGE 1

PPRINT/MESSAGE 2

 

Second problem : i would like display my 2 PPRINT on the same line , like this : PPRINT/ MESSAGE 1 ; MESSAGE 2

 

thanks for the help

 

NX8.5

 


This will be hard to do.  Do you ALWAYS (and I mean ALWAYS) have *exactly 2* PPRINTs?

What happens if there is only 1 PPRINT?

What happens if there are 3?

While you can easily read & store the messages (and not output them right away)...

You don't know when you have all the PPRINTs, so you don't know when you can output the messages (unless you use another event, e.g. "start of path" or "initial move", to trigger the output...)

Or you could add your own UDE (mkn_output_pprint?) that would have to be added after all the other PPRINTs to trigger the output? 

Unfortunately the operation "notes" feature was added in NX9, so that option is out (as the notes are an array, you can process them all at once)

If you could better describe what you are trying to accomplish, there may be other ways to do it.

 

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: TCL : Mom_pprint

I perform a plan for my company, i take out a file ( xls ) which includes information according to my process.

For it I get operations names to handle operations in particular and information which are inside. I create a html file like that:

Oper_count / time / tool_name / operator_message / number pages

 

For messages operators I want to use PPRINT because DISPLY  is to use for some PP command in my company.

 

To make my array for messages operators I create this line:

MOM_output_literal "<td ALIGN=CENTER WIDTH=100 HEIGHT=100 >$mom_pprint</td > "

 

And to answer your question:

"Do you ALWAYS (and I mean ALWAYS) have *exactly 2* PPRINTs?"

 

 I have no limits !

 

What I would like it is to have an exit(release) like that:

 

MOM_output_literal "<td ALIGN=CENTER WIDTH=100 HEIGHT=100 >$mom_pprint(1)<br>$mon_pprint(2)<br>$mom_pprint(3)<br>mom_pprint(...)</td>"

 

My example(same line) in my last post was not exact, because here I add « <br > »

 

add a UDE , I didn't think, it is a good idea

 

@mkn

Re: TCL : Mom_pprint

Have you looked at the "Operator Message" UDE?

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: TCL : Mom_pprint


Ken_A wrote:

Have you looked at the "Operator Message" UDE?


same problem

@mkn

Re: TCL : Mom_pprint

Time to start debugging.

 

1) In your MOM_pprint, add a line like the following:

MOM_output_text "In my MOM_pprint"

Put before any logic

Then post your program - do you get your line ("In my MOM_pprint") out?

- If yes, go to next step

- if no, you'll have to root thru the post's tcl file to see if Siemens re-defines (over-rides) your MOM_pprint, and figure out how to over-ride their re-definition. (search for their "proc MOM_pprint", and see if it is in an "uplevel" - if so, what proc is that "uplevel" in, and see where that is called.  Repeat as needed to find the "root" proc that end up re-defining MOM_pprint.  Then you'll have to add your own PB_CMD_* to re-define MOM_pprint to do what YOU want)

 

2) Once you get the above line out, if you STILL don't get anything else, try my proc "Moog_Show_Globals" (search the community here for it) and add that to your proc.  Search the output for the pprint tect you entered, and see what the real variable name is.

 

Note (I think) sometimes the PPRINT data is ONLY intended to go to the LPT file, so it may do some odd things compared to other UDEs.

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: TCL : Mom_pprint

[ Edited ]

Hello!

 

If you can use the "Notes"-Function (I think it came with NX9) I have a solution:

 

Event: Initial or First Move

 

   if { $mom_operation_notes(0) != "" } {
     set i 0
     set output_notes ""
     while { $mom_operation_notes($i) != "" } {
       lappend output_notes $mom_operation_notes($i)
       set mom_operation_notes($i) ""
       if {$i < 24} {incr i}
     }
     MOM_output_literal "; $output_notes"

   }

 

 

Output:

 

; Note1 Note2 Note3 Note4 Note5

 

In my example I have limited the number of notes to 24. Sometime you have a problem with the length of the output-line.

 

Werner

 

Re: TCL : Mom_pprint

He's on NX8.5 (per original post)

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: TCL : Mom_pprint

tkanks @jobe , but like  @Ken_A says ,i am on NX8.5

 

@Ken_A :

I don't have time to look your proc , but as soon as I have time and i make you a feedback.

 

@mkn

Re: TCL : Mom_pprint

@jobe thanks for the notes idea.

I have another example of outputting the notes array on single lines - maybe it will give somebody some ideas.

#=============================================================
proc PB_CMD_output_operation_notes { } {
#=============================================================
#
#  Output operation notes one line at a time.
#  Add this to the Start of Path event. 
#
   global mom_operation_notes

  # If notes are defined, output each line of text from the array.
   if { [info exists mom_operation_notes] && [array exists mom_operation_notes] } {

      OPERATOR_MSG "------------------- Operation Notes ----------------------"
      foreach i [lsort [array names mom_operation_notes]] {
         OPERATOR_MSG "$mom_operation_notes($i)"
     }
      OPERATOR_MSG "----------------------------------------------------------"

     # Clear for next operation
      array unset mom_operation_notes
   }
}
Mark Rief
Retired Siemens

Learn online





Solution Information