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
  • See below

    ASSIGN/PAR_ALLHITS1=".HIT[1.."
    ASSIGN/PAR_ALLHITS2=".NUMHITS]"
    ASSIGN/ALLHITS=FUNCTION((IDA),(IDA)+PAR_ALLHITS1+(IDA)+PA R_ALLHITS2)
    MOVE/CLEARPLANE
    CIR3 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0.1
    ACTL/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0.1
    TARG/<0.16,-1.69,-5.804>,<1,0,0>
    START ANG=198.3311,END ANG=339.7178
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=7,DEPTH=0.1969,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=BOTH,DISTANCE=0.3937
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    MOVE/CLEARPLANE
    CIR4 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0.16,-1.69,-5.804>,<-1,0,0>,16.32,0.1
    ACTL/<0.16,-1.69,-5.804>,<-1,0,0>,16.32,0.1
    TARG/<0.16,-1.69,-5.804>,<-1,0,0>
    START ANG=18.3311,END ANG=159.7178
    ANGLE VEC=<0,0,1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=7,DEPTH=0.1969,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=BOTH,DISTANCE=0.3937
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    CIR5 =FEAT/CIRCLE,CARTESIAN,OUT,LEAST_SQR,NO
    THEO/<0,0,0>,<0,0,1>,1
    ACTL/<1.935,-1.69,-5.804>,<0,0,1>,1
    CONSTR/CIRCLE,BFRE,2D,ALLHITS("CIR3"),ALLHITS("CIR4"),,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,UPR=0​​
Reply
  • See below

    ASSIGN/PAR_ALLHITS1=".HIT[1.."
    ASSIGN/PAR_ALLHITS2=".NUMHITS]"
    ASSIGN/ALLHITS=FUNCTION((IDA),(IDA)+PAR_ALLHITS1+(IDA)+PA R_ALLHITS2)
    MOVE/CLEARPLANE
    CIR3 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0.1
    ACTL/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0.1
    TARG/<0.16,-1.69,-5.804>,<1,0,0>
    START ANG=198.3311,END ANG=339.7178
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=7,DEPTH=0.1969,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=BOTH,DISTANCE=0.3937
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    MOVE/CLEARPLANE
    CIR4 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0.16,-1.69,-5.804>,<-1,0,0>,16.32,0.1
    ACTL/<0.16,-1.69,-5.804>,<-1,0,0>,16.32,0.1
    TARG/<0.16,-1.69,-5.804>,<-1,0,0>
    START ANG=18.3311,END ANG=159.7178
    ANGLE VEC=<0,0,1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=7,DEPTH=0.1969,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=BOTH,DISTANCE=0.3937
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    CIR5 =FEAT/CIRCLE,CARTESIAN,OUT,LEAST_SQR,NO
    THEO/<0,0,0>,<0,0,1>,1
    ACTL/<1.935,-1.69,-5.804>,<0,0,1>,1
    CONSTR/CIRCLE,BFRE,2D,ALLHITS("CIR3"),ALLHITS("CIR4"),,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,UPR=0​​
Children