Peter: Attached are two macros (from Dan McAnarney) that will create a tool list with any desired info (using jos tags) at the start of your code file without duplicates.
The main macro is codeinfo.mcl. (The other one, delimit.mcl, is executed within the main. Has something to do with double-slashes) How the codeinfo.mcl macro works: A file is created with the same name as the jof except with a .cg extension. The file is assigned to the variable #S2 and placed in the jobnotes section of the jof. There is a loop that cycles through all of the steps/tools in the jobfile. A test is performed to determine if the tool is used in the model file. If it is used, the required tool info (jos tags) is returned and assigned to variables. The info is formatted and written to the *.cg file. The model file is coded and the *.cg file is included at the beginning. You will need to: -Change any path statements -Edit the lines that determine the tool/step info that you need (jos tags). -Edit the F_WRITE to format and write your desired output to the *.cg file. -Include in the @START section of your cg template file the following: #IFSTR(#S2<>)< #INCLUDE(#S2)> Dan has alot of comments throughout the program so it should be pretty easy to follow. It works quite well. There is a known problem if there are unused steps/tools that are masked in your model file. Those tool's info is output even though they are not being used. There should be an easy fix for this. I just never got to it. Hope it helps Pete -----Original Message----- From: Bui, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 24, 2001 2:15 AM To: SmartCAM List (E-mail) Subject: [mfg-smartcam] Tool List Hi all, I've tried out this Tool List, and found that if there is more than one occurrences of a tool, the info for that tool will be output again. How can this be prevented? Please help! @START #CALL(TOOLLIST) @TOOLLIST #IF(#U10=1)<***** THIS IS THE TOOL LIST SECTION *****> #EVAL(#U17=1) #EVAL(#U18=0) #REPEAT(TOTEL())< #EVAL(#U19=JTOOL(#U17) #IF(#U19>0,AND#U19<>#U18)< #EVAL(#S19=TDESC(#U19)) #EVAL(#V19=TLDIA(#U19)) #EVAL(#V18=TLEN(#U19)) #EVAL(#V17=TLOFF(#U20)) ( Tool matrix location =#U19 Tool Diameter.=#V19 Tool description = #S19 Tool Length =#U20)> #EVAL(#U18=#U19) #EVAL(#U17=#U17+1)> @ Thanks Peter Bui CRANE ELDEC Corporation Phone: (425) 743-1313 Ext. 8758 FAX: (425) 743-8549 Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Web Page: www.ELDEC.com <http://www.ELDEC.com> ====================================================================== To find out more about this mailing list including how to unsubscribe, send the message "info mfg-smartcam" to [EMAIL PROTECTED] ======================================================================
Delimit.mcl
Description: Binary data
codeinfo.MCL
Description: Binary data
