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
  • Here are the basic instructions to create a Constructed Circle from two circles.


    Code before constructing a constructed Circle.

    PART NAME  : TestGenericFunctions
    REV NUMBER : 1
    SER NUMBER : 20230316
    STATS COUNT : 1
     
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                MODE/DCC
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                LOADPROBE/4BY20_40E_TP20MF_100E
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                ASSIGN/PAR_ALLHITS1=".HIT[1.."
                ASSIGN/PAR_ALLHITS2=".NUMHITS]"
                ASSIGN/ALLHITS=FUNCTION((IDA),(IDA)+PAR_ALLHITS1+(IDA)+PAR_ALLHITS2)
    CIR3       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                THEO/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                ACTL/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                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=YES
                  VOID DETECTION=NO
                  REMEASURE=NO
                  SURFACE=THICKNESS_NONE,0
                  MEASURE MODE=NOMINALS
                  RMEAS=NONE,NONE,NONE
                  AUTO WRIST=NO
                  CIRCULAR MOVES=STRAIGHT
                  GRAPHICAL ANALYSIS=NO
                  FEATURE LOCATOR=NO,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
    CIR4       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                THEO/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                ACTL/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                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=YES
                  VOID DETECTION=NO
                  REMEASURE=NO
                  SURFACE=THICKNESS_NONE,0
                  MEASURE MODE=NOMINALS
                  RMEAS=NONE,NONE,NONE
                  AUTO WRIST=NO
                  CIRCULAR MOVES=STRAIGHT
                  GRAPHICAL ANALYSIS=NO
                  FEATURE LOCATOR=NO,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
                WORKPLANE/XPLUS​
    


    After creating the two Auto Circles open the Construct Circle dialog window and select CIR3 in the list of features.
    CIR3 will be highlighted in the Graphics window showing each hit used for CIR3.
    Left mouse click at least 3 hits to create the constructed circle.


    This will be the code for the constructed circle.
    CIR1       =FEAT/CIRCLE,CARTESIAN,OUT,LEAST_SQR,NO
                THEO/<0.3569,-1.69,-5.804>,<1,0,0>,16.32
                ACTL/<0.3569,-1.69,-5.804>,<1,0,0>,16.32
                CONSTR/CIRCLE,BF,2D,CIR3.HIT[1..1],CIR3.HIT[4..4],CIR3.HIT[7..7],,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,UPR=0​
    


    Now edit the CIR3.HIT[1..1] by double left mouse click to highlight the hit and then type in ALLHITS("CIR3"), Hit the Tab key to edit CIR3.HIT[4..4] and type in ALLHITS("CIR4"). Hit the Tap key again and delete the CIR3.HIT[4..4]. As shown in the code below.
    CIR1       =FEAT/CIRCLE,CARTESIAN,OUT,LEAST_SQR,NO
                THEO/<0.3569,-1.69,-5.804>,<1,0,0>,16.32
                ACTL/<0.3569,-1.69,-5.804>,<1,0,0>,16.32
                CONSTR/CIRCLE,BF,2D,ALLHITS("CIR3"),ALLHITS("CIR4"),,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,UPR=0​
    


    Here is the caption of CIR3, CIR4 and CIR1


    Here is the complete code sample.
    PART NAME  : TestGenericFunctions
    REV NUMBER : 1
    SER NUMBER : 20230316
    STATS COUNT : 1
     
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                MODE/DCC
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                LOADPROBE/4BY20_40E_TP20MF_100E
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                ASSIGN/PAR_ALLHITS1=".HIT[1.."
                ASSIGN/PAR_ALLHITS2=".NUMHITS]"
                ASSIGN/ALLHITS=FUNCTION((IDA),(IDA)+PAR_ALLHITS1+(IDA)+PAR_ALLHITS2)
    CIR3       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                THEO/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                ACTL/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                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=YES
                  VOID DETECTION=NO
                  REMEASURE=NO
                  SURFACE=THICKNESS_NONE,0
                  MEASURE MODE=NOMINALS
                  RMEAS=NONE,NONE,NONE
                  AUTO WRIST=NO
                  CIRCULAR MOVES=STRAIGHT
                  GRAPHICAL ANALYSIS=NO
                  FEATURE LOCATOR=NO,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
    CIR4       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                THEO/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                ACTL/<0.16,-1.69,-5.804>,<1,0,0>,16.32,0
                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=YES
                  VOID DETECTION=NO
                  REMEASURE=NO
                  SURFACE=THICKNESS_NONE,0
                  MEASURE MODE=NOMINALS
                  RMEAS=NONE,NONE,NONE
                  AUTO WRIST=NO
                  CIRCULAR MOVES=STRAIGHT
                  GRAPHICAL ANALYSIS=NO
                  FEATURE LOCATOR=NO,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
                WORKPLANE/XPLUS
    CIR1       =FEAT/CIRCLE,CARTESIAN,OUT,LEAST_SQR,NO
                THEO/<0.3569,-1.69,-5.804>,<1,0,0>,16.32
                ACTL/<0.3569,-1.69,-5.804>,<1,0,0>,16.32
                CONSTR/CIRCLE,BF,2D,ALLHITS("CIR3"),ALLHITS("CIR4"),,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,UPR=0​
    
  • No problem. Glad it worked out for you.
Reply Children
No Data