Hello Guest it is December 14, 2019, 09:12:22 PM

Author Topic: Read out User defined fields from Tool table  (Read 822 times)

0 Members and 1 Guest are viewing this topic.

Offline GerdS

*
  •  42 42
    • View Profile
Read out User defined fields from Tool table
« on: February 05, 2017, 01:58:35 PM »
Hello, is there an easy way to read out User defined fields from the Tool table.
I already played with mcToolGetData and the UsrField.... values from the tool table.
The API documented types from "mcToolGetData", have the same name like in the tooltable.tls. For example:FieldType1=MTOOL_MILL_HEIGHT:Float(-1,4)
Tryed to use my defined name, but no luck.

Thanks
Gerd

Offline GerdS

*
  •  42 42
    • View Profile
Re: Read out User defined fields from Tool table
« Reply #1 on: February 10, 2017, 08:28:01 AM »
For everybody who did not know, here is the solution.

mcToolGetDataExDbl()
mcToolGetDataExInt()
mcToolGetDataExStr()

local dblVal, rc = mc.mcToolGetDataExDbl(number mInst, number toolnum, string fieldName)
local strlVal, rc = mc.mcToolGetDataExStr(number mInst, number toolnum, string fieldName)

You can find this and many more undocumented functions it in the autocomplete list in the LUA Editor.

Thanks to Brett from the Tech support staff for his help.

An example i did is attached.