There is an ABSOLUTE function in v11.5 with similar syntax as v4.5

#Z3=#Z1-ABS(#CBDEPTH)

Math Functions for Macros, from page 80 of the SmartCAM Customization guide

Math Operations
SmartCAM supports a variety of math operations.
Notice that the operators SQR, ABS, SGN, INT,and DMS in the following list
are not preceded by the pound sign (#):

Operator Meaning
+ add
- subtract
* multiply
/ divide
^ exponential
SQR square root
ABS absolute value
SGN return sign (+/-)
INT integer value
DMS converts strings of the form DDD.MMSS to decimal


=============================================
 Fred Lauzus, CAM Programming Coordinator
 High Steel Structures, Incorporated
 mailto:[EMAIL PROTECTED] http://www.highsteel.com
=============================================
 


� 

-----Original Message-----
From: Michael Senack [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 17, 2000 8:47 AM
To: '[EMAIL PROTECTED]'
Subject: [mfg-smartcam] Absolute variable entry


Is there an ABSOLUTE command in V11.5 mcl language?

I'm converting a V4.5 .mac macro file to a V11.5 .mcl macro file.
In the V4.5 macro file I used the ABS command in front of the #CBDEPTH
variable because, if you enter a minus number for the CBDEPTH variable it is
changed into a positive number.

Variables
Enter_Val
$#Z3=#Z1-ABS(#CBDEPTH)
@CR

Here is the V11.5 macro file...

PROMPT[TX="Enter the Z_level for the top surface of the counterbore.",
VN="Z1"]
PROMPT[TX="Enter the Z_level for the bottom surface of the counterbore.",
VN="Z2"]
PROMPT[TX="Enter the counterbore diameter.", VN="CBOREDIA"]
PROMPT[TX="Enter the depth of the counterbore.", VN="CBDEPTH"]<-- I WANT
THIS TO BE ALWAYS A POSITIVE NUMBER
PROMPT[TX="Enter the hole diameter.", VN="HOLEDIA"]
//
ON_LAYER[LY=15, WP="XY_PLANE", LV=#Z1-#CBDEPTH, PT=#Z1]
//
ARC[DR=0, XC=#X1, YC=#Y1, RA=#CBOREDIA/2, AS=0, AE=0, SE=2, SS=2, 
    SI=2, SC=2, LV=#Z1-#CBDEPTH]
//
ON_LAYER[LY=15, WP="XY_PLANE", LV=#Z2, PT=#Z1-#CBDEPTH]
//
ARC[DR=0, XC=#X1, YC=#Y1, RA=#HOLEDIA/2, AS=0, AE=0, SE=2, SS=2, SI=2, SC=2,
LV=#Z2]

I know I can use a WHILE loop to check the variable CBDEPTH and test if it
is less then zero try again but...

Thanks in advance for any suggestions.

Regards,

Michael Senack, X354
Your local friendly neighborhood CNC Programmer


======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================

Reply via email to