Cancel
Showing results for 
Search instead for 
Did you mean: 

Tool List problem

Pioneer
Pioneer

I am using the CC "PB_CMD_create_tool_list" comes default with NX 

we can output tool list in Three ways :

#    "ORDER_IN_USE"    "ALL_UNIQUE"  &   "GROUP_BY_TYPE"  

 

I was outputting only using GROUP_BY_TYPE untill now, But now i want to output if T1 is used earlier & i am using T1 again after few tool & i want to output T1 in tool list again.

example :

Operation 1 : T1

Operation 1_1 : T1

Operation 2 : T2

Operation 2_1 : T2

Operation 3 : T1

 

I want to output tool list as :

T1

T2

T1

 

Thank you

 

12 REPLIES

Re: Tool List problem

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Seems you now want ORDER_IN_USE to get tools in the order they are used and also get duplicates, if I am not mistaken.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Tool List problem

Pioneer
Pioneer

Thank you @Stefan_Pendl 

Yes, But when i use ORDER_IN_USE it is giving tool list output for all operations.

I want to output order in use but not to duplicate...

For example :

Operation 1 : uses tool 1  : T1

Operation 2 : uses tool 1 : T1

Operation 3 : uses tool 2 : T2

Operation 4 : uses tool 2 : T2

Operation 5 : uses tool 1 : T1

 

I get output with ORDER_IN_USE  :

T1***

T1***

T2****

T2****

T1***

 

BUT tool list output i want is :

T1***

T2****

T1***

 

Thank you...

 

Re: Tool List problem

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Seems you will have to extend the default logic in this case.

What I would do is the following:

  1. introduce my own list type, like set mom_sys_tool_list_output_type "ORDER_IN_USE_UNIQUE"
  2. create your own tool list, like set tool_list $mom_sys_tool_stack(IN_USE_UNIQUE)
  3. you will have to adapt multiple places, so you would need to change one thing after the other
    • adding tools only to the stack if the last one is not the current one
    • calculate machining time
    • may be more haven't checked any further

You may be spending half a day on this enhancement, but then you get what you want.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Tool List problem

Pioneer
Pioneer

@Stefan_Pendl:

I tried & somehow was not able to get what i expected & changed the approach.

Add the tool numbers in one list & rewrite the output & i saw the solution given by @FROBI earlier.

1) program start seq : 

global aa_tool_list
set aa_tool_list [list]

 

MOM_output_literal "aaToolLst"

 

2) At every tool change appending the tool number to $aa_tool_list,

 

3) at the end of program :

global aa_tool_list
global mom_output_file_full_name
global some_temp_filename
global handle_r handle_w

MOM_close_output_file $mom_output_file_full_name

set handle_r [open $mom_output_file_full_name r]
set some_temp_filename "G:\\vvvv.txt"
set handle_w [open $some_temp_filename w]

while { [gets $handle_r buf] > 0 } {
       if { [string match "aaToolLst" $buf] } {
           set l [llength $aa_tool_list]
           for { set i 0 } { $i < $l } { incr i } {
                set buf [lindex $aa_tool_list $i]
               }
          }
      puts $handle_w $buf
     }

close $handle_r
close $handle_w
file delete $mom_output_file_full_name
file rename $some_temp_filename $mom_output_file_full_name

 

can you guide me what i am doing wrong here as i am not getting the tool list at the top ??

 

Thank you 

 

Re: Tool List problem

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

What does the NC file look like before it is delete?

What does the new NC file look like?

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Tool List problem

Pioneer
Pioneer

Both looks the same..with the text as a marker to output my TOOL LIST

 

N10 aaToolLst

N20 ;Start of Program

N30 ;

N40 DEF REAL _camtolerance

 

i am guessing that the logic need lil modification but not able to pin point what needs modification ??

Re: Tool List problem

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Post the part that would be replaced by the tool list with some lines above and below it.

We don't know how it looks like, so we cannot help you.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Tool List problem

Pioneer
Pioneer

@Stefan_Pendl: Sorry for the vague reply..

In original file i have kept  literal output as "aaToolLst" for the location where i want to output tool list.

N10 aaToolLst
N20 ;Start of Program
N30 ;
N40 DEF REAL _camtolerance
N50 DEF REAL _X_HOME, _Y_HOME,

with re writen output i want to replace "aaToolLst" with the the output

N10 Tool List
N11 T1
N12 T2
N13 T1
N20 ;Start of Program
N30 ;
N40 DEF REAL _camtolerance
N50 DEF REAL _X_HOME, _Y_HOME,

But i am getting the same output in both file like the origional

N10 aaToolLst
N20 ;Start of Program
N30 ;
N40 DEF REAL _camtolerance
N50 DEF REAL _X_HOME, _Y_HOME,  

 

Re: Tool List problem

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
if { [string match "aaToolLst" $buf] } {

The above only matches lines that contain just that single word, since match is exact matching.

If you like to match against a line that can have a block number or anything else, then you need to add wild-card characters.

if { [string match "*aaToolLst*" $buf] } {

This will match a line that will contain the word and allows to have something before, like the line number, and something behind, like a space character.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Learn online





Solution Information