Do you know how to import a tool from an external file?

Tools can be directly programmed into the CAD system. However, some programmers prefer using an external file that contains their tools. Quest has a function which lets the user read from an external file and extract the necessary information.
expl


Here’s how to get tool information from an external file:

  1. Prepare the tool file you want to read from. For this example, we will be reading from a text file which was placed in the same directory as the Aptsource. Also, take note of the structure of the text file. The list is composed of Tool numbers separated by commas, with their respective tool name.
    Untitled
  2. Open your post processor in Quest;
  3. In the navigation panel, go to Post-processor Customization > Startup/Shutdown Procedures;
    ssproc
  4. Expand the section by pressing on the ‘+. Access the Tool change startup macro. Select Tool change startup macro and create the following custom macro:

$$ Replace programmed tool number with number in external file
DECLAR/LOCAL,STRING,ONE_LINE,TL_POS=’’
IF/$TLNAME.NE.’’
OPEN/21,$FDIRNAM($CLNAME)//’\Tool.txt’
WHILE/.NOT.$FEOF(21) $$ Search tool name in tooling file
READ/21,’!(A80)’,ONE_LINE
IF/$FMATCH(ONE_LINE,$TLNAME).NE.’’
TL_POS=$FMATCH(ONE_LINE,’^([0-9][0-9]*),’,’\1’)
EXIT/1
ENDOF/IF
ENDOF/WHILE
CLOSE/21
IF/TL_POS.NE.’’
$P1=$FATOF(TL_POS) $$ Replaces tool number with tool number on the list
ELSE
ERROR/8,’Tool “!(A)” not found in the tooling list. ‘//$
‘Will use tool number programmed originally (T!(s2)).’,$TLNAME,$P1
ENDOF/IF
ENDOF/IF

The macro should look similar to this:

Still looking for more help?

Upgrade to a Maintenance & Support plan customized for you provided by ICAM Foundation Experts.

2019-03-05T19:02:09+00:00September 5th, 2018|Categories: ICAM Foundation|

Shopping Cart