Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

post proc custom command help

Status
Not open for further replies.

moog2

Mechanical
Jan 16, 2007
441
i have a custom command which sets the tool length compensation number to be the same as the tool number, it goes as follows:
-------------------------------------------------------
global mom_tool_number
global mom_tool_adjust_register
global mom_cutcom_adjust_register

set mom_tool_adjust_register $mom_tool_number
set mom_cutcom_adjust_register $mom_tool_number
-------------------------------------------------------

can someone please show me how to put an IF -> ELSE
statement in, so if i want to specify a different length offset number, i can...
I tried myself, but can't get it working..
 
Replies continue below

Recommended for you

if {..} {..} else {..}

if [info exists mom_tool_adjust_register] {
if {$mom_tool_adjust_register != 0} {
set mom_tool_adjust_register $mom_tool_number
}
}
 
thanks for the reply,
but that still doesn't seem to work, even tho i've input a number into the adjust register of that turning tool, it's still output it as the tool number.
Any idea why ??
 
Check the variables used in the def file and change the logic a bit if you didn't to:

global mom_tool_number mom_tool_adjust_register

if [info exists mom_tool_adjust_register] {
if {$mom_tool_adjust_register == 0} {
set mom_tool_adjust_register $mom_tool_number
}
} else {
set mom_tool_adjust_register $mom_tool_number
}

if this does not work then it could be that the mom_tool_adjust_register is changed after you did. Sometimes it is only possible to change the output with your own variables e.g.

global Tool
global mom_tool_adjust_register
global mom_tool_number

if [info exists mom_tool_adjust_register] {
if {$mom_tool_adjust_register == 0} {
set Tool(AdjustRegister) $mom_tool_number
}
} else {
set Tool(AdjustRegister) $mom_tool_number
}
 
not altogether sure what you mean by using my own variable, but, thanks, i'll try that.
 
Thanks very much,
the first one of your second reply works great.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor