cancel
Showing results for 
Search instead for 
Did you mean: 

Custom field in tool_database

Valued Contributor
Valued Contributor

Hello, in file tool_database.dat added a custom fields, named as LALL.

I use a file dbc_tool_ud_data.tcl to display in tool edit dialog.

How to access a variable with value of field LALL from machining_data.tcl (Feeds and Speeds lib) ?

Its need to use a value as tool length

7 REPLIES

Re: Custom field in tool_database

You should be able to read the library fields directly from the tcl file, like we do in shop docs or the post. For example:

    if {[info exists mom_libref]} {
  
  MOM_ask_library_attributes LIBRARY_TOOL $mom_libref Type SubType Descr Holder HolderDes

  set lib_type $mom_lib_attr_value(Type)
  set lib_subtype $mom_lib_attr_value(SubType)
...
Mark Rief
Retired Siemens

Re: Custom field in tool_database

Valued Contributor
Valued Contributor

I try it, but don't have any result, mom_libref not exist.

Maybe i'm doing something wrong.

Include code in file machining_data.tcl, and try to get feeds and speeds data - have error.

Re: Custom field in tool_database

Valued Contributor
Valued Contributor

I performed some tests with feeds_speeds library files.

In .tcl file tool_machining_data.tcl variable dbc_libref contain a right value, tool libref, for tool in operation.

I try to get a DB_ALIAS array use a code sample. But it could't complete with error:

Event Handler: C:\Program Files\Siemens\NX 10.0\mach\resource\library\feeds_speeds\ascii\tool_machining_data.tcl, Event: DBC_retrieve, Error: can't read "mom_lib_attr_value(Type)": no such variable
    while executing
"set lib_type $mom_lib_attr_value(Type)"
    (procedure "DBC_retrieve" line 60)
    invoked from within "DBC_retrieve"*** EXCEPTION: Error code  1770002 in line 519 of o:\ugnx1003\ip5\src\camsmom\no\ind\mom_tcl_definitions.c at Thu Apr 13 20:18:27 2017 RTZ 9 

Code:

	global lib_type
	global lib_subtype
	global mom_lib_attr_value
	if {[info exists dbc_libref]} {

	MOM_ask_library_attributes LIBRARY_TOOL $dbc_libref Type SubType Descr Holder HolderDes

	set lib_type $mom_lib_attr_value(Type)
	set lib_subtype $mom_lib_attr_value(SubType)
	}

If try it in file machining_data.tcl, then have a error: MOM: The MOM_ask_library_attributes function is called with an invalid LIBREF

variable dbc_libref is empty.

How can get a db field from machining_data.tcl.

I work in NX 10.0.3.5 MP13

Re: Custom field in tool_database

For debugging, I would hard code  dbc_libref to a known good value, and then write out the Type and Subtype that are returned. 

Mark Rief
Retired Siemens

Re: Custom field in tool_database

Valued Contributor
Valued Contributor
Need a variable with tool libref from operation. It exists in DBC_retrieve from tool_machining_data.tcl, but not exists in file machining_data.tcl in same procedure.

Re: Custom field in tool_database


Kingston wrote:
Need a variable with tool libref from operation. It exists in DBC_retrieve from tool_machining_data.tcl, but not exists in file machining_data.tcl in same procedure.

Now I understand. The system does not need the libref for machining_data.tcl to calculate, so the variable is not made available. This would be an ER.

To get it today, you would need to extend the tcl with an API program to look at the current operation, get the tool parent, and ask for the libref.  

Mark Rief
Retired Siemens

Re: Custom field in tool_database

Valued Contributor
Valued Contributor

I solved my problem.

I use a global variable to array dbc_ud_param_value and get a need value.

Learn online





Solution Information