hexagon logo

How to add variable hole size

We have part numbers that have several dash numbers after them that basically are the same part but the hole size varies depending on the dash number.  I was wondering how I could write the program where the operator could just input the hole diameter at the beginning of the program (or select from a dropdown menu list of hole sizes) and have the program run.  Obviously this input would be need to be fed into a variable.  I'm just not sure how the syntax is.  Any ideas?

Parents
  • If your program name contains a dash code relating to the hole diameter then there is no need to have the operator enter it.  You can get the program name as a variable using ASSIGN/V1=GETPROGRAMINFO("PARTNAME").  You can then manipulate that variable to extract the relevant dash number.  For example, if the dash number is always the last 2 digits of the program name, then ASSIGN/V2=RIGHT(V1,2) would put those 2 digits into variable V2.  Once you have the dash code, you can add IF/END_IF or SELECT/CASE logic to your routine to set the diameter based on the dash code or, if the dash code IS the hole diameter, you can use the V2 variable directly.

  • The dash code doesn't relate directly to the hole diameter.  You still have to look at the drawing and that particular dash number will refer to a chart and there might be more than one hole that will vary in size depending on the dash number.  In that case, I would need operator input.  And I'm still not sure how to incorporate that into the hole size(s) in the program.

  • There is many different ways you can control this. You can use operator input to determine what to use easily. You can also put the relevant chart data into arrays based on the dash number if theres multiple features that can change. Can you give an example of a Dash Number and how many holes it controls? 

    Something like this where based on the dash number, and number of holes the chart controls, the diameters of the holes change

    INPUT      =LABEL/
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Enter Dash Number
                IF/C1.INPUT=="520"
                  ASSIGN/V1=ARRAY(.281,.375,1)
                  GOTO/HOLES
                END_IF/
                IF/C1.INPUT=="525"
                  ASSIGN/V1=ARRAY(.5, .325, .520)
                  GOTO/HOLES
                END_IF/
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,OVC=NO,
                INVALID ENTRY
                GOTO/INPUT
    HOLES      =LABEL/
    CR1        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-0.938,0,0>,<0,0,1>,V1[1]
                ACTL/<-0.938,0,0>,<0,0,1>,0.281
                TARG/<-0.938,0,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
    CR2        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<1,-1,0>,<0,0,1>,V1[2]
                ACTL/<1,-1,0>,<0,0,1>,0.375
                TARG/<1,-1,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
    CR3        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-2.558,-1.5,0>,<0,0,1>,V1[3]
                ACTL/<-2.558,-1.5,0>,<0,0,1>,1
                TARG/<-2.558,-1.5,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

    I also have it so if the input isn't any you've set it for, it throws an "error" and loops back to the input

Reply
  • There is many different ways you can control this. You can use operator input to determine what to use easily. You can also put the relevant chart data into arrays based on the dash number if theres multiple features that can change. Can you give an example of a Dash Number and how many holes it controls? 

    Something like this where based on the dash number, and number of holes the chart controls, the diameters of the holes change

    INPUT      =LABEL/
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Enter Dash Number
                IF/C1.INPUT=="520"
                  ASSIGN/V1=ARRAY(.281,.375,1)
                  GOTO/HOLES
                END_IF/
                IF/C1.INPUT=="525"
                  ASSIGN/V1=ARRAY(.5, .325, .520)
                  GOTO/HOLES
                END_IF/
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,OVC=NO,
                INVALID ENTRY
                GOTO/INPUT
    HOLES      =LABEL/
    CR1        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-0.938,0,0>,<0,0,1>,V1[1]
                ACTL/<-0.938,0,0>,<0,0,1>,0.281
                TARG/<-0.938,0,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
    CR2        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<1,-1,0>,<0,0,1>,V1[2]
                ACTL/<1,-1,0>,<0,0,1>,0.375
                TARG/<1,-1,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
    CR3        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-2.558,-1.5,0>,<0,0,1>,V1[3]
                ACTL/<-2.558,-1.5,0>,<0,0,1>,1
                TARG/<-2.558,-1.5,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

    I also have it so if the input isn't any you've set it for, it throws an "error" and loops back to the input

Children
No Data