Fred,
I've made quite a few changes to the macro you originally sent, but it does
work if I comment out the WHILE loop to pad the 0's. I hope someone can
spot the error I must have made. I can then add a few more variables and
turn it into a nice little numbering array macro!
Jim S.
> Jim,
>
> I downloaded my previous email attachment from the list server and
> executed it in Advanced Production Milling v11.5 without error. Did you
> make any modifications to the macro? If so, let me see what changes you
> made. If you've made no changes, you may try clearing your variables
> first by selecting "Macro - Variables - Remove All - Done" from the menu.
>
> =============================================
> Fred Lauzus, CAM Programming Coordinator
> High Steel Structures, Incorporated
> mailto:[EMAIL PROTECTED] http://www.highsteel.com
> =============================================
>
>
>
>
> -----Original Message-----
> From: Jim Schellpfeffer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 06, 2001 11:31 AM
> To: Lauzus, Frederick
> Subject: RE: [mfg-smartcam] Engraving Macro
>
>
> Thanks for your help Fred, I was able to get a "kick start" from your macro.
> One problem though, I could not get the WHILE loop that adds the 0's to run!
> It stops on the WHILE(STRLEN(#NumberStr)<3) and tells me
> "unknown macro command"
> I am running Advanced Production Milling V11.5 if that makes any
> difference!
> Any idea what the problem is?
>
> Thanks again,
> Jim S.
>
> > Try this loop to get you started.
> >
> >
> > =============================================
> > Fred Lauzus, CAM Programming Coordinator
> > High Steel Structures, Incorporated
> > mailto:[EMAIL PROTECTED] http://www.highsteel.com
> > =============================================
> >
> >
> >
> >
> > -----Original Message-----
> > From: Jim Schellpfeffer [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 05, 2001 10:55 AM
> > To: [EMAIL PROTECTED]
> > Subject: [mfg-smartcam] Engraving Macro
> >
> >
> > I need to engrave some small flat pieces with serial numbers 001 thru
> 1000,
> > not wanting to re-invent the wheel I figured someone out there would have
> a
> > macro to do the job. I could customize it for my needs but if someone
> would
> > have the "frame work" to start with I would greatly appreciate it!
> >
> > Jim S.
> >
> > Jim Schellpfeffer
> > Machine Dev. & Maint. Group
> > [EMAIL PROTECTED]
> > (630)840-4029
> > ======================================================================
> > To find out more about this mailing list including how to unsubscribe,
> > send the message "info mfg-smartcam" to [EMAIL PROTECTED]
> > ======================================================================
> >
> >
>
>
> Jim Schellpfeffer
> Machine Dev. & Maint. Group
> [EMAIL PROTECTED]
> (630)840-4029
> ======================================================================
> To find out more about this mailing list including how to unsubscribe,
> send the message "info mfg-smartcam" to [EMAIL PROTECTED]
> ======================================================================
Jim Schellpfeffer
Machine Dev. & Maint. Group
[EMAIL PROTECTED]
(630)840-4029
// SmartCAM v11.5 milling macro file
// TxtNumbers.mcl
// Generates text for engraving part numbers
// from 1 to 1000 with a minimum of 3 digits.
//
// declare string variables
STRING:#NumberStr
// set counter to first part number
#Counter=1
// make step active
WITH_STEP[ST=20, WP="XY_PLANE", OF=2, LV=-.51, CL=0.1, PT=?]
// Set counter to 1st row
#Ctr2=1
// loop 40 columns and 25 rows
// Set Y start point
#Y1=1.04
// loop for 25 rows
WHILE(#Ctr2<=25)
// set counter for 1st column
#Ctr3=1
// set X start point
#X1=0.1449
// loop for 40 columns
WHILE(#Ctr3<=40)
// assign number to string variable
#NumberStr=STRTMP("%Counter")
// padd number with leading zeros if less than 3 digits
WHILE(STRLEN(#NumberStr)<3)
#NumberStr=STRTMP("0%NumberStr")
ENDW
// create text as geometry
TEXT[FN="../shared/fonts/afont.sh2", TX=#NumberStr,
XS=#X1, YS=#Y1, AN=0, HT=.125, TY=0, LV=0]
// Index X position, Column counter & Number counter
#X1=#X1+0.688
#Ctr3=#Ctr3+1
#Counter=#Counter+1
ENDW
// Index Y position & Row counter
#Y1=#Y1+1.313
#Ctr2=#Ctr2+1
ENDW