hexagon logo

More Generic Function Example

Construct Features Hits Function

Here is an example on how to use functions to simplify the syntax when typing in the commands for a Constructed Circle from two Auto Circles.

If you have two Auto Circles named CIR1 and CIR2 then you would have to use the syntax CIR1.HIT[1..CIR1.NUMHITS],CIR2.HIT[1..CIR2.NUMHITS] for the Constructed Circle.

With this Function example

ASSIGN/PAR_ALLHITS1=".HIT[1.."
ASSIGN/PAR_ALLHITS2=".NUMHITS]"
ASSIGN/ALLHITS=FUNCTION((IDA),(IDA)+PAR_ALLHITS1+(IDA)+PAR_ALLHITS2)

All you have to type in is ALLHITS("CIR1"),ALLHITS("CIR2")

Code example
ASSIGN/PAR_ALLHITS1=".HIT[1.."
ASSIGN/PAR_ALLHITS2=".NUMHITS]"
ASSIGN/ALLHITS=FUNCTION((IDA),(IDA)+PAR_ALLHITS1+(IDA)+PAR_ALLHITS2)
CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<4.291,3.5036,0>,<0,0,1>,0.6457
ACTL/<4.291,3.5036,0>,<0,0,1>,0.6457
TARG/<4.291,3.5036,0>,<0,0,1>
START ANG=0,END ANG=360
ANGLE VEC=<1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
CIR2 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<4.291,3.5036,-0.7874>,<0,0,1>,0.6457
ACTL/<4.291,3.5036,-0.7874>,<0,0,1>,0.6457
TARG/<4.291,3.5036,-0.7874>,<0,0,1>
START ANG=0,END ANG=360
ANGLE VEC=<1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
CIR5 =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,NO
THEO/<4.291,3.5036,-0.3937>,<0,0,1>,0.6457
ACTL/<4.291,3.5036,-0.3937>,<0,0,1>,0.6457
CONSTR/CIRCLE,BFRE,2D,ALLHITS("CIR1"),ALLHITS("CIR2"),,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,UPR=0
CIR3 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<3.1496,2.3622,0>,<0,0,1>,2.3622
ACTL/<3.1496,2.3622,0>,<0,0,1>,2.3622
TARG/<3.1496,2.3622,0>,<0,0,1>
START ANG=0,END ANG=360
ANGLE VEC=<1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
CIR4 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<3.1496,2.3622,-0.7874>,<0,0,1>,2.3622
ACTL/<3.1496,2.3622,-0.7874>,<0,0,1>,2.3622
TARG/<3.1496,2.3622,-0.7874>,<0,0,1>
START ANG=0,END ANG=360
ANGLE VEC=<1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
CIR6 =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,NO
THEO/<3.1496,2.3622,-0.3937>,<0,0,1>,2.3622
ACTL/<3.1496,2.3622,-0.3937>,<0,0,1>,2.3622
CONSTR/CIRCLE,BFRE,2D,ALLHITS("CIR3"),ALLHITS("CIR4"),,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,UPR=0
Parents Reply Children