Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

How to add NX CAM program number easily?

Is there a way to simply create/type the program number? something like this.

As far as I've researched there's not much documentation.

What I had to do for this to work is edit the postprocessor add a custom command (program_header) then go to nx NC_PROGRAM add an attribute then type program name, but it's too much of a hassle to do it, and for me that I'm always programming well...

 

O0001 (1234)
(SOLO MINI-MILL)
G40 G17 G49 G80 G90
G1
M01
T01 M06
S3000 M03

10 REPLIES

Re: How to add NX CAM program number easily?

You coul duse an attribute, but a more visible method is to use the name of the program group.

Our default setup assemblies use "1234".

 

 

Then add a custom command like this to the start of program in your post:

 

#=============================================================
proc PB_CMD_set_program_id_from_group_name { } {
#=============================================================
   global mom_group_name mom_user_program_number

   if [info exists mom_group_name] {
      set mom_user_program_number [string range $mom_group_name 0 3]
   } else {
      set mom_user_program_number 1234
      set mom_group_name "Program Name Missing"
   }

}
Mark Rief
Retired Siemens

Re: How to add NX CAM program number easily?

I created the new custom command like you said and added it after the "%" in the program start sequence, but when I postprocess nothing shows up, I don't know what I'm doing wrong so bear with me since I'm new Man Tongue

Re: How to add NX CAM program number easily?

You need at least MOM_output_literal or MOM_do_template to output anything to the NC code file.

In the provided example procedure there is nothing included, so you need to add it on your own.

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

How to Get the Most from Your Signature in the Community

Re: How to add NX CAM program number easily?

[ Edited ]

Instead of telling me to add it on my own couldn't you just type waht I should´ve added? because the answer means nothing to me since I´m new to TCL. My attempt is this

#=============================================================
proc PB_CMD_set_program_id_from_group_name { } {
#=============================================================
   global mom_group_name
   global mom_user_program_number

   if [info exists mom_group_name] {set mom_user_program_number [string range $mom_group_name 0 3]
   } else {
      set mom_user_program_number 1234
      set mom_group_name "Program Name Missing"
   }
      MOM_output_literal "$mom_user_program_number($mom_group_name)"

}

Re: How to add NX CAM program number easily?

A big problem is taht in "start of program", the post doesn't know what the group name is yet.  (the "start of program" event happens before the "start of group" event).

 

basically, at "start of program", the only things the post knows are

- part name

- output file name

- PART attributes (defined interactively in File -> Properties -> "Attributes" tab)

- info about the post itself

 

And not much else.

In the post docs (and I believe it has been posted here as well)  there is a list of the order of events that are seen when posting a part

 

So in order to use the group name for output in the posted file, you have to wait for the "start of group" event, or the event handler for it ("MOM_start_of_group", IIRC)

 

Ken

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


Solution
Solution
Accepted by topic author AndresO
‎12-17-2015 03:51 PM

Re: How to add NX CAM program number easily?

What isn't posting correctly? All of it, some of it? It looks like for starters you're missing the O at the beginning.

 

I use mom_parent_group_name in the Start of Program Event, everything after the % is output by MOM_machine_mode so it should be available. Turn on the review tool when posting and you can see most of the variables available at each line posted.

 

Try this,

 

MOM_output_literal "O$mom_user_program_number($mom_parent_group_name)"

 

And try to not be so rude, most of us on here help because we can not because we have to.

Solution
Solution
Accepted by topic author AndresO
‎12-17-2015 03:52 PM

Re: How to add NX CAM program number easily?

Hi, so my work around was this, thanks diamond and everyone for your support

   global mom_attr_PROGRAMVIEW_PROGRAM_NUMBER
   global mom_group_name

   if { ![info exists mom_group_name] } { set mom_group_name "" }

   if { ![info exists mom_attr_PROGRAMVIEW_PROGRAM_NUMBER] } {
      set mom_attr_PROGRAMVIEW_PROGRAM_NUMBER "O"
   }

   MOM_output_literal "$mom_attr_PROGRAMVIEW_PROGRAM_NUMBER$mom_group_name"

Re: How to add NX CAM program number easily?

[ Edited ]

@AndresO, as a new community member, you may not be aware of all the resources available here. If you are going to be maintaining posts, I recommend you take a look at some of the videos available on Post Processors and TCL in the Tech Tips area

 

Mark Rief
Retired Siemens

Re: How to add NX CAM program number easily?

How would I do it with the attribute instead ? Our program groups are named per part and OP, sometimes feature specific. I'd like to use the program group properties and set a CAM attribute there, what would the TCL look like for it?
Organization, an essential part of Productivity !

Production: NX10.0.3 MP13, VERICUT 8.0
Development: VB.NET, Tcl/Tk Testing: NX11.0, iMachining 2.0, Adaptive Roughing

Learn online





Solution Information