Using Sub-programs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Sub-programs

    Hi Guys.

    There is a first time for everything, I'm told.

    I have never worked with sub-programming before, at least not with PC-DMIS.

    I have 4 versions of a part, and some of the geometry are on all 4 versions, but not at the same place.
    Other geometries are on 2 but not on the last 2 versions.

    The geometries are holes that looks like tulips.
    In the bottom, they have a cylinder, then a cone and finish of with the inside of a torus ( or donut).


    I was wondering, if it would be smarter for me to make the items in a sub-program, so that when the customer make changes, I'll only have to make my changes in the sub-program, instead of having them changed I all 4 programs.
    But, how di I do it?

    I mean, how do I get the dimension out of hole number 1 and keep the measured data from hole number 2?
    I have 4 holes looking the same, but on the report I'd like to have 4 different geometries measured and reported.
    Do I have to ASSIGN some variables every time the sub-program return some values, or....?


    If any one could post a screenshot of the concept, I'd be very happy.
    Or help me in any other way with a few tips of tricks, maybe even traps....


    Best regards

    Michael
    -- o --
    DEA Global - 09-15-08
    Renishaw PH10MQ w/ TP200 & SCR200-Rack
    PC-DMIS CAD Ver. 2017 R2 / PC-DMIS 2011 MR1

  • #2
    I think I would do it by reading different text files containig theo values, and a case/end case at the start (look at DAN_M posts about it)

    Comment


    • #3
      You can dimension from a Sub with geometry in your part routine. You can also add geometry in the sub, to dimension geometry from sub in your part program is a bit tricky but doable.

      Dimensions in Sub, Geometry in part routine method.

      Program...
      Code:
      PART NAME  : delete
      REV NUMBER :
      SER NUMBER :
      STATS COUNT : 1
      
      STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                  ALIGNMENT/END
                  MODE/MANUAL
                  FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                  LOADPROBE/LSPX1_2X40
                  TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
      MAN_ALIGN  =GROUP/SHOWALLPARAMS=YES
      PLN1         =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE
                    THEO/<4.3256,0.4986,0>,<0,0,1>
                    ACTL/<4.3256,0.4986,0>,<0,0,1>
                    TARG/<4.3256,0.4986,0>,<0,0,1>
                    ANGLE VEC=<1,0,0>,SQUARE
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=2,NUMROWS=2
                      SPACER=1.5
                      AVOIDANCE MOVE=NO,DISTANCE=0.3937
                    SHOW HITS=NO
      A1           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1
                      ALIGNMENT/TRANS,ZAXIS,PLN1
                    ALIGNMENT/END
      LIN1         =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                    ACTL/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                    TARG/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=3,DEPTH=0
                      SAMPLE METHOD=SAMPLE_HITS
                      SAMPLE HITS=3,SPACER=0,INDENT1=0,INDENT2=0
                      AVOIDANCE MOVE=NO,DISTANCE=0
                    SHOW HITS=NO
      A2           =ALIGNMENT/START,RECALL:A1,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1
                      ALIGNMENT/TRANS,ZAXIS,PLN1
                      ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,YAXIS,LIN1
                    ALIGNMENT/END
      PNT1         =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                    THEO/<0,0.4215,-1.0676>,<-1,0,0>
                    ACTL/<0,0.4215,-1.0676>,<-1,0,0>
                    TARG/<0,0.4215,-1.0676>,<-1,0,0>
                    SNAP=NO
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=NO,DISTANCE=0.3937
                    SHOW HITS=NO
      A3           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1
                      ALIGNMENT/TRANS,ZAXIS,PLN1
                      ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,YAXIS,LIN1
                      ALIGNMENT/TRANS,XAXIS,PNT1
                    ALIGNMENT/END
                  ENDGROUP/ID=MAN_ALIGN
                  CLEARP/ZPLUS,0.25,ZPLUS,0,OFF
                  MOVE/CLEARPLANE
      DCC_ALIGN  =GROUP/SHOWALLPARAMS=YES
                    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                    Changing to DCC mode! Do not continue unless avoidance moves have been added.
                    MODE/DCC
      PLN1_DCC     =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE
                    THEO/<4.3256,0.4986,0>,<0,0,1>
                    ACTL/<4.3256,0.4986,0>,<0,0,1>
                    TARG/<4.3256,0.4986,0>,<0,0,1>
                    ANGLE VEC=<1,0,0>,SQUARE
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=2,NUMROWS=2
                      SPACER=1.5
                      AVOIDANCE MOVE=NO,DISTANCE=0.3937
                    SHOW HITS=NO
      A3_DCC1      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                      ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                      ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,YAXIS,LIN1
                      ALIGNMENT/TRANS,XAXIS,PNT1
                    ALIGNMENT/END
                    MOVE/CLEARPLANE
      LIN1_DCC     =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                    ACTL/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                    TARG/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=3,DEPTH=0
                      SAMPLE METHOD=SAMPLE_HITS
                      SAMPLE HITS=3,SPACER=0,INDENT1=0,INDENT2=0
                      AVOIDANCE MOVE=NO,DISTANCE=0
                    SHOW HITS=NO
      A3_DCC2      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                      ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                      ALIGNMENT/ROTATE,XPLUS,TO,LIN1_DCC,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,YAXIS,LIN1_DCC
                      ALIGNMENT/TRANS,XAXIS,PNT1
                    ALIGNMENT/END
                    MOVE/CLEARPLANE
      PNT1_DCC     =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                    THEO/<0,0.4215,-1.0676>,<-1,0,0>
                    ACTL/<0,0.4215,-1.0676>,<-1,0,0>
                    TARG/<0,0.4215,-1.0676>,<-1,0,0>
                    SNAP=NO
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=NO,DISTANCE=0.3937
                    SHOW HITS=NO
      A3_DCC3      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                      ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                      ALIGNMENT/ROTATE,XPLUS,TO,LIN1_DCC,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,YAXIS,LIN1_DCC
                      ALIGNMENT/TRANS,XAXIS,PNT1_DCC
                    ALIGNMENT/END
                    MOVE/CLEARPLANE
                  ENDGROUP/ID=DCC_ALIGN
      CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<3.6811,3.1693,0>,<0,0,1>,0.5906
                  ACTL/<3.6811,3.1693,0>,<0,0,1>,0.5906
                  TARG/<3.6811,3.1693,0>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                    SAMPLE METHOD=SAMPLE_HITS
                    SAMPLE HITS=3,SPACER=0.065
                    AVOIDANCE MOVE=NO,DISTANCE=0.15
                    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                  SHOW HITS=NO
                  MOVE/CLEARPLANE
      CIR2       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<6.0827,3.1693,0>,<0,0,1>,0.5906
                  ACTL/<6.0827,3.1693,0>,<0,0,1>,0.5906
                  TARG/<6.0827,3.1693,0>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                    SAMPLE METHOD=SAMPLE_HITS
                    SAMPLE HITS=3,SPACER=0.065
                    AVOIDANCE MOVE=NO,DISTANCE=0.15
                    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                  SHOW HITS=NO
                  MOVE/CLEARPLANE
      CIR3       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<6.0827,0.7677,0>,<0,0,1>,0.5906
                  ACTL/<6.0827,0.7677,0>,<0,0,1>,0.5906
                  TARG/<6.0827,0.7677,0>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                    SAMPLE METHOD=SAMPLE_HITS
                    SAMPLE HITS=3,SPACER=0.065
                    AVOIDANCE MOVE=NO,DISTANCE=0.15
                    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                  SHOW HITS=NO
                  MOVE/CLEARPLANE
      CIR4       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<3.6811,0.7677,0>,<0,0,1>,0.5906
                  ACTL/<3.6811,0.7677,0>,<0,0,1>,0.5906
                  TARG/<3.6811,0.7677,0>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                    SAMPLE METHOD=SAMPLE_HITS
                    SAMPLE HITS=3,SPACER=0.065
                    AVOIDANCE MOVE=NO,DISTANCE=0.15
                    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                  SHOW HITS=NO
                  MOVE/CLEARPLANE
      CS1        =CALLSUB/PART1_DIMS,C:\Users\Public\Documents\WAI\PC-DMIS\2015.1\Subroutines\Subroutine_Dimensions.PRG:{CIR1},{CIR2},{CIR3},{CIR3},,
      Last edited by Kp61dude!; 01-07-2019, 09:29 AM.
      PcDmis 2015.1 SP10 CAD++
      Global 7-10-7 DC800S

      Comment


      • #4
        Subroutine

        Code:
        PART NAME  : Subroutine_Dimensions
        REV NUMBER :
        SER NUMBER :
        STATS COUNT : 1
        
        STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                    ALIGNMENT/END
                    MODE/MANUAL
                    FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                    LOADPROBE/LSPX1_2X40
                    TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                    GOTO/END
        FORREF1    =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
                    NOM/XYZ,<0,0,0>,$
                    MEAS/XYZ,<0,0,0>,$
                    NOM/IJK,<0,0,1>,$
                    MEAS/IJK,<0,0,1>,$
                    RADIUS/1,1
        PART#1     =GROUP/SHOWALLPARAMS=YES
                      SUBROUTINE/PART1_DIMS,
                          TCIR1 =  : ,
                          TCIR2 =  : ,
                          TCIR3 =  : ,
                          TCIR4 =  : ,
                           =
          DIM LOC1= LOCATION OF CIRCLE TCIR1  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          Y       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          D       2.0000     0.0150     0.0150     2.0000     0.0000     0.0000 ----#----
          END OF DIMENSION LOC1
          DIM LOC2= LOCATION OF CIRCLE TCIR2  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          Y       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          D       2.0000     0.0150     0.0150     2.0000     0.0000     0.0000 ----#----
          END OF DIMENSION LOC2
          DIM LOC3= LOCATION OF CIRCLE TCIR3  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          Y       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          D       2.0000     0.0150     0.0150     2.0000     0.0000     0.0000 ----#----
          END OF DIMENSION LOC3
          DIM LOC4= LOCATION OF CIRCLE TCIR4  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          Y       0.0000     0.0100     0.0100     0.0000     0.0000     0.0000 ----#----
          D       2.0000     0.0150     0.0150     2.0000     0.0000     0.0000 ----#----
          END OF DIMENSION LOC4
                      ENDSUB/
                    ENDGROUP/ID=PART#1
        END        =LABEL/
        notice I built a generic name "FORREF1" outside of sub "PART1_DIMS", I had to do that in order to create location dimensions. Those dimensions later got addressed to "TCIR1" thru "TCIR4". Otherwise your dimension will light up red as if there's an Error.
        Last edited by Kp61dude!; 01-07-2019, 09:13 AM.
        PcDmis 2015.1 SP10 CAD++
        Global 7-10-7 DC800S

        Comment


        • #5
          Geometry in Subroutine, Dimensions in part routine method.

          Here's the tricky part I mentioned (well not so tricky just took me a long time to figure out).

          Part Routine:
          Code:
          PART NAME  : delete
          REV NUMBER :
          SER NUMBER :
          STATS COUNT : 1
          
          STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                      ALIGNMENT/END
                      MODE/MANUAL
                      FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                      LOADPROBE/LSPX1_2X40
                      TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
          MAN_ALIGN  =GROUP/SHOWALLPARAMS=YES
          PLN1         =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE
                        THEO/<4.3256,0.4986,0>,<0,0,1>
                        ACTL/<4.3256,0.4986,0>,<0,0,1>
                        TARG/<4.3256,0.4986,0>,<0,0,1>
                        ANGLE VEC=<1,0,0>,SQUARE
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                          NUMHITS=2,NUMROWS=2
                          SPACER=1.5
                          AVOIDANCE MOVE=NO,DISTANCE=0.3937
                        SHOW HITS=NO
          A1           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                          ALIGNMENT/LEVEL,ZPLUS,PLN1
                          ALIGNMENT/TRANS,ZAXIS,PLN1
                        ALIGNMENT/END
          LIN1         =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                        THEO/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                        ACTL/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                        TARG/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                          NUMHITS=3,DEPTH=0
                          SAMPLE METHOD=SAMPLE_HITS
                          SAMPLE HITS=3,SPACER=0,INDENT1=0,INDENT2=0
                          AVOIDANCE MOVE=NO,DISTANCE=0
                        SHOW HITS=NO
          A2           =ALIGNMENT/START,RECALL:A1,LIST=YES
                          ALIGNMENT/LEVEL,ZPLUS,PLN1
                          ALIGNMENT/TRANS,ZAXIS,PLN1
                          ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                          ALIGNMENT/TRANS,YAXIS,LIN1
                        ALIGNMENT/END
          PNT1         =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<0,0.4215,-1.0676>,<-1,0,0>
                        ACTL/<0,0.4215,-1.0676>,<-1,0,0>
                        TARG/<0,0.4215,-1.0676>,<-1,0,0>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                          AVOIDANCE MOVE=NO,DISTANCE=0.3937
                        SHOW HITS=NO
          A3           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                          ALIGNMENT/LEVEL,ZPLUS,PLN1
                          ALIGNMENT/TRANS,ZAXIS,PLN1
                          ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                          ALIGNMENT/TRANS,YAXIS,LIN1
                          ALIGNMENT/TRANS,XAXIS,PNT1
                        ALIGNMENT/END
                      ENDGROUP/ID=MAN_ALIGN
                      CLEARP/ZPLUS,0.25,ZPLUS,0,OFF
                      MOVE/CLEARPLANE
          DCC_ALIGN  =GROUP/SHOWALLPARAMS=YES
                        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                        Changing to DCC mode! Do not continue unless avoidance moves have been added.
                        MODE/DCC
          PLN1_DCC     =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE
                        THEO/<4.3256,0.4986,0>,<0,0,1>
                        ACTL/<4.3256,0.4986,0>,<0,0,1>
                        TARG/<4.3256,0.4986,0>,<0,0,1>
                        ANGLE VEC=<1,0,0>,SQUARE
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                          NUMHITS=2,NUMROWS=2
                          SPACER=1.5
                          AVOIDANCE MOVE=NO,DISTANCE=0.3937
                        SHOW HITS=NO
          A3_DCC1      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                          ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                          ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                          ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                          ALIGNMENT/TRANS,YAXIS,LIN1
                          ALIGNMENT/TRANS,XAXIS,PNT1
                        ALIGNMENT/END
                        MOVE/CLEARPLANE
          LIN1_DCC     =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                        THEO/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                        ACTL/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                        TARG/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                          NUMHITS=3,DEPTH=0
                          SAMPLE METHOD=SAMPLE_HITS
                          SAMPLE HITS=3,SPACER=0,INDENT1=0,INDENT2=0
                          AVOIDANCE MOVE=NO,DISTANCE=0
                        SHOW HITS=NO
          A3_DCC2      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                          ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                          ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                          ALIGNMENT/ROTATE,XPLUS,TO,LIN1_DCC,ABOUT,ZPLUS
                          ALIGNMENT/TRANS,YAXIS,LIN1_DCC
                          ALIGNMENT/TRANS,XAXIS,PNT1
                        ALIGNMENT/END
                        MOVE/CLEARPLANE
          PNT1_DCC     =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<0,0.4215,-1.0676>,<-1,0,0>
                        ACTL/<0,0.4215,-1.0676>,<-1,0,0>
                        TARG/<0,0.4215,-1.0676>,<-1,0,0>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                          AVOIDANCE MOVE=NO,DISTANCE=0.3937
                        SHOW HITS=NO
          A3_DCC3      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                          ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                          ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                          ALIGNMENT/ROTATE,XPLUS,TO,LIN1_DCC,ABOUT,ZPLUS
                          ALIGNMENT/TRANS,YAXIS,LIN1_DCC
                          ALIGNMENT/TRANS,XAXIS,PNT1_DCC
                        ALIGNMENT/END
                        MOVE/CLEARPLANE
                      ENDGROUP/ID=DCC_ALIGN
          CS1        =CALLSUB/PART1_GEO,C:\Users\Public\Documents\WAI\PC-DMIS\2015.1\Subroutines\Subroutine_Dimensions.PRG:,,,,,
          DIM LOC1= LOCATION OF CIRCLE CS1:CIR1  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       3.6811     0.0100     0.0100     3.6811     0.0000     0.0000 ----#-----
          Y       3.1693     0.0100     0.0100     3.1693     0.0000     0.0000 ----#-----
          D       0.5906     0.0150     0.0150     0.5906     0.0000     0.0000 ----#-----
          END OF DIMENSION LOC1
          DIM LOC2= LOCATION OF CIRCLE CS1:CIR2  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       6.0827     0.0100     0.0100     6.0827     0.0000     0.0000 ----#-----
          Y       3.1693     0.0100     0.0100     3.1693     0.0000     0.0000 ----#-----
          D       0.5906     0.0150     0.0150     0.5906     0.0000     0.0000 ----#-----
          END OF DIMENSION LOC2
          DIM LOC3= LOCATION OF CIRCLE CS1:CIR3  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       6.0827     0.0100     0.0100     6.0827     0.0000     0.0000 ----#-----
          Y       0.7677     0.0100     0.0100     0.7677     0.0000     0.0000 ----#-----
          D       0.5906     0.0150     0.0150     0.5906     0.0000     0.0000 ----#-----
          END OF DIMENSION LOC3
          DIM LOC4= LOCATION OF CIRCLE CS1:CIR4  UNITS=IN ,$
          GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
          AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
          X       3.6811     0.0100     0.0100     3.6811     0.0000     0.0000 ----#-----
          Y       0.7677     0.0100     0.0100     0.7677     0.0000     0.0000 ----#-----
          D       0.5906     0.0150     0.0150     0.5906     0.0000     0.0000 ----#-----
          END OF DIMENSION LOC4
          Last edited by Kp61dude!; 01-07-2019, 09:29 AM.
          PcDmis 2015.1 SP10 CAD++
          Global 7-10-7 DC800S

          Comment


          • #6
            Subroutine:
            Code:
            PART NAME  : Subroutine_Dimensions
            REV NUMBER :
            SER NUMBER :
            STATS COUNT : 1
            
            STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                        ALIGNMENT/END
                        MODE/MANUAL
                        FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                        LOADPROBE/LSPX1_2X40
                        TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                        GOTO/END
            PART#1     =GROUP/SHOWALLPARAMS=YES
                          SUBROUTINE/PART1_GEO,
                               =
            CIR1         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                          THEO/<3.6811,3.1693,0>,<0,0,1>,0.5906
                          ACTL/<3.6811,3.1693,0>,<0,0,1>,0.5906
                          TARG/<3.6811,3.1693,0>,<0,0,1>
                          START ANG=0,END ANG=360
                          ANGLE VEC=<1,0,0>
                          DIRECTION=CCW
                          SHOW FEATURE PARAMETERS=NO
                          SHOW CONTACT PARAMETERS=YES
                            NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                            SAMPLE METHOD=SAMPLE_HITS
                            SAMPLE HITS=3,SPACER=0.065
                            AVOIDANCE MOVE=NO,DISTANCE=0.15
                            FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                          SHOW HITS=NO
                          MOVE/CLEARPLANE
            CIR2         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                          THEO/<6.0827,3.1693,0>,<0,0,1>,0.5906
                          ACTL/<6.0827,3.1693,0>,<0,0,1>,0.5906
                          TARG/<6.0827,3.1693,0>,<0,0,1>
                          START ANG=0,END ANG=360
                          ANGLE VEC=<1,0,0>
                          DIRECTION=CCW
                          SHOW FEATURE PARAMETERS=NO
                          SHOW CONTACT PARAMETERS=YES
                            NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                            SAMPLE METHOD=SAMPLE_HITS
                            SAMPLE HITS=3,SPACER=0.065
                            AVOIDANCE MOVE=NO,DISTANCE=0.15
                            FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                          SHOW HITS=NO
                          MOVE/CLEARPLANE
            CIR3         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                          THEO/<6.0827,0.7677,0>,<0,0,1>,0.5906
                          ACTL/<6.0827,0.7677,0>,<0,0,1>,0.5906
                          TARG/<6.0827,0.7677,0>,<0,0,1>
                          START ANG=0,END ANG=360
                          ANGLE VEC=<1,0,0>
                          DIRECTION=CCW
                          SHOW FEATURE PARAMETERS=NO
                          SHOW CONTACT PARAMETERS=YES
                            NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                            SAMPLE METHOD=SAMPLE_HITS
                            SAMPLE HITS=3,SPACER=0.065
                            AVOIDANCE MOVE=NO,DISTANCE=0.15
                            FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                          SHOW HITS=NO
                          MOVE/CLEARPLANE
            CIR4         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                          THEO/<3.6811,0.7677,0>,<0,0,1>,0.5906
                          ACTL/<3.6811,0.7677,0>,<0,0,1>,0.5906
                          TARG/<3.6811,0.7677,0>,<0,0,1>
                          START ANG=0,END ANG=360
                          ANGLE VEC=<1,0,0>
                          DIRECTION=CCW
                          SHOW FEATURE PARAMETERS=NO
                          SHOW CONTACT PARAMETERS=YES
                            NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                            SAMPLE METHOD=SAMPLE_HITS
                            SAMPLE HITS=3,SPACER=0.065
                            AVOIDANCE MOVE=NO,DISTANCE=0.15
                            FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                          SHOW HITS=NO
                          MOVE/CLEARPLANE
                          ENDSUB/
                        ENDGROUP/ID=PART#1
            END        =LABEL/
            PcDmis 2015.1 SP10 CAD++
            Global 7-10-7 DC800S

            Comment


            • #7
              You can also combine geometry and dimensions in subroutine or have a separate sub call for geometry and call for dimensions all in one subroutine library.

              Dimensions and Geometry in Sub method.

              Part routine:
              Code:
              PART NAME  : delete
              REV NUMBER :
              SER NUMBER :
              STATS COUNT : 1
              
              STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                          ALIGNMENT/END
                          MODE/MANUAL
                          FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                          LOADPROBE/LSPX1_2X40
                          TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
              MAN_ALIGN  =GROUP/SHOWALLPARAMS=YES
              PLN1         =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE
                            THEO/<4.3256,0.4986,0>,<0,0,1>
                            ACTL/<4.3256,0.4986,0>,<0,0,1>
                            TARG/<4.3256,0.4986,0>,<0,0,1>
                            ANGLE VEC=<1,0,0>,SQUARE
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              NUMHITS=2,NUMROWS=2
                              SPACER=1.5
                              AVOIDANCE MOVE=NO,DISTANCE=0.3937
                            SHOW HITS=NO
              A1           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,PLN1
                              ALIGNMENT/TRANS,ZAXIS,PLN1
                            ALIGNMENT/END
              LIN1         =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                            THEO/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                            ACTL/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                            TARG/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              NUMHITS=3,DEPTH=0
                              SAMPLE METHOD=SAMPLE_HITS
                              SAMPLE HITS=3,SPACER=0,INDENT1=0,INDENT2=0
                              AVOIDANCE MOVE=NO,DISTANCE=0
                            SHOW HITS=NO
              A2           =ALIGNMENT/START,RECALL:A1,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,PLN1
                              ALIGNMENT/TRANS,ZAXIS,PLN1
                              ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                              ALIGNMENT/TRANS,YAXIS,LIN1
                            ALIGNMENT/END
              PNT1         =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                            THEO/<0,0.4215,-1.0676>,<-1,0,0>
                            ACTL/<0,0.4215,-1.0676>,<-1,0,0>
                            TARG/<0,0.4215,-1.0676>,<-1,0,0>
                            SNAP=NO
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              AVOIDANCE MOVE=NO,DISTANCE=0.3937
                            SHOW HITS=NO
              A3           =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,PLN1
                              ALIGNMENT/TRANS,ZAXIS,PLN1
                              ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                              ALIGNMENT/TRANS,YAXIS,LIN1
                              ALIGNMENT/TRANS,XAXIS,PNT1
                            ALIGNMENT/END
                          ENDGROUP/ID=MAN_ALIGN
                          CLEARP/ZPLUS,0.25,ZPLUS,0,OFF
                          MOVE/CLEARPLANE
              DCC_ALIGN  =GROUP/SHOWALLPARAMS=YES
                            COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                            Changing to DCC mode! Do not continue unless avoidance moves have been added.
                            MODE/DCC
              PLN1_DCC     =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE
                            THEO/<4.3256,0.4986,0>,<0,0,1>
                            ACTL/<4.3256,0.4986,0>,<0,0,1>
                            TARG/<4.3256,0.4986,0>,<0,0,1>
                            ANGLE VEC=<1,0,0>,SQUARE
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              NUMHITS=2,NUMROWS=2
                              SPACER=1.5
                              AVOIDANCE MOVE=NO,DISTANCE=0.3937
                            SHOW HITS=NO
              A3_DCC1      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                              ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                              ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                              ALIGNMENT/TRANS,YAXIS,LIN1
                              ALIGNMENT/TRANS,XAXIS,PNT1
                            ALIGNMENT/END
                            MOVE/CLEARPLANE
              LIN1_DCC     =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                            THEO/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                            ACTL/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>,5.5504
                            TARG/<1.6132,0,0>,<1,0,0>,<0,-1,0>,<0,0,1>
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              NUMHITS=3,DEPTH=0
                              SAMPLE METHOD=SAMPLE_HITS
                              SAMPLE HITS=3,SPACER=0,INDENT1=0,INDENT2=0
                              AVOIDANCE MOVE=NO,DISTANCE=0
                            SHOW HITS=NO
              A3_DCC2      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                              ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                              ALIGNMENT/ROTATE,XPLUS,TO,LIN1_DCC,ABOUT,ZPLUS
                              ALIGNMENT/TRANS,YAXIS,LIN1_DCC
                              ALIGNMENT/TRANS,XAXIS,PNT1
                            ALIGNMENT/END
                            MOVE/CLEARPLANE
              PNT1_DCC     =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                            THEO/<0,0.4215,-1.0676>,<-1,0,0>
                            ACTL/<0,0.4215,-1.0676>,<-1,0,0>
                            TARG/<0,0.4215,-1.0676>,<-1,0,0>
                            SNAP=NO
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              AVOIDANCE MOVE=NO,DISTANCE=0.3937
                            SHOW HITS=NO
              A3_DCC3      =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
                              ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
                              ALIGNMENT/ROTATE,XPLUS,TO,LIN1_DCC,ABOUT,ZPLUS
                              ALIGNMENT/TRANS,YAXIS,LIN1_DCC
                              ALIGNMENT/TRANS,XAXIS,PNT1_DCC
                            ALIGNMENT/END
                            MOVE/CLEARPLANE
                          ENDGROUP/ID=DCC_ALIGN
              CS1        =CALLSUB/PART1_GEO,C:\Users\Public\Documents\WAI\PC-DMIS\2015.1\Subroutines\Subroutine_Dimensions.PRG:,,,,,
              CS2        =CALLSUB/PART1_DIMS,C:\Users\Public\Documents\WAI\PC-DMIS\2015.1\Subroutines\Subroutine_Dimensions.PRG:{CS1:CIR1},{CS1:CIR2},{CS1:CIR3},{CS1:CIR4},,,
              Last edited by Kp61dude!; 01-07-2019, 09:30 AM.
              PcDmis 2015.1 SP10 CAD++
              Global 7-10-7 DC800S

              Comment


              • #8
                Subroutine:
                Code:
                PART NAME  : Subroutine_Dimensions
                REV NUMBER :
                SER NUMBER :
                STATS COUNT : 1
                
                STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                            ALIGNMENT/END
                            MODE/MANUAL
                            FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                            LOADPROBE/LSPX1_2X40
                            TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                            GOTO/END
                FORREF1    =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
                            NOM/XYZ,<0,0,0>,$
                            MEAS/XYZ,<0,0,0>,$
                            NOM/IJK,<0,0,1>,$
                            MEAS/IJK,<0,0,1>,$
                            RADIUS/1.5,1.5
                PART#1_GEO =GROUP/SHOWALLPARAMS=YES
                              SUBROUTINE/PART1_GEO,
                                   =
                CIR1         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                              THEO/<3.6811,3.1693,0>,<0,0,1>,0.5906
                              ACTL/<3.6811,3.1693,0>,<0,0,1>,0.5906
                              TARG/<3.6811,3.1693,0>,<0,0,1>
                              START ANG=0,END ANG=360
                              ANGLE VEC=<1,0,0>
                              DIRECTION=CCW
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                                SAMPLE METHOD=SAMPLE_HITS
                                SAMPLE HITS=3,SPACER=0.065
                                AVOIDANCE MOVE=NO,DISTANCE=0.15
                                FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                              SHOW HITS=NO
                              MOVE/CLEARPLANE
                CIR2         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                              THEO/<6.0827,3.1693,0>,<0,0,1>,0.5906
                              ACTL/<6.0827,3.1693,0>,<0,0,1>,0.5906
                              TARG/<6.0827,3.1693,0>,<0,0,1>
                              START ANG=0,END ANG=360
                              ANGLE VEC=<1,0,0>
                              DIRECTION=CCW
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                                SAMPLE METHOD=SAMPLE_HITS
                                SAMPLE HITS=3,SPACER=0.065
                                AVOIDANCE MOVE=NO,DISTANCE=0.15
                                FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                              SHOW HITS=NO
                              MOVE/CLEARPLANE
                CIR3         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                              THEO/<6.0827,0.7677,0>,<0,0,1>,0.5906
                              ACTL/<6.0827,0.7677,0>,<0,0,1>,0.5906
                              TARG/<6.0827,0.7677,0>,<0,0,1>
                              START ANG=0,END ANG=360
                              ANGLE VEC=<1,0,0>
                              DIRECTION=CCW
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                                SAMPLE METHOD=SAMPLE_HITS
                                SAMPLE HITS=3,SPACER=0.065
                                AVOIDANCE MOVE=NO,DISTANCE=0.15
                                FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                              SHOW HITS=NO
                              MOVE/CLEARPLANE
                CIR4         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                              THEO/<3.6811,0.7677,0>,<0,0,1>,0.5906
                              ACTL/<3.6811,0.7677,0>,<0,0,1>,0.5906
                              TARG/<3.6811,0.7677,0>,<0,0,1>
                              START ANG=0,END ANG=360
                              ANGLE VEC=<1,0,0>
                              DIRECTION=CCW
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                NUMHITS=4,DEPTH=0.125,PITCH=0.0492
                                SAMPLE METHOD=SAMPLE_HITS
                                SAMPLE HITS=3,SPACER=0.065
                                AVOIDANCE MOVE=NO,DISTANCE=0.15
                                FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                              SHOW HITS=NO
                              MOVE/CLEARPLANE
                              ENDSUB/
                            ENDGROUP/ID=PART#1_GEO
                PART#1_DIMS=GROUP/SHOWALLPARAMS=YES
                              SUBROUTINE/PART1_DIMS,
                                  TCIR1 =  : ,
                                  TCIR2 =  : ,
                                  TCIR3 =  : ,
                                  TCIR4 =  : ,
                                   =
                  DIM LOC1= LOCATION OF CIRCLE TCIR1  UNITS=IN ,$
                  GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
                  AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                  X       3.6811     0.0000     0.0000     3.6811     0.0000     0.0000 #--------
                  Y       3.1693     0.0000     0.0000     3.1693     0.0000     0.0000 #--------
                  Z       0.0000     0.0000     0.0000     0.0000     0.0000     0.0000 #--------
                  D       0.5906     0.0000     0.0000     0.5906     0.0000     0.0000 #--------
                  END OF DIMENSION LOC1
                  DIM LOC2= LOCATION OF CIRCLE TCIR2  UNITS=IN ,$
                  GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
                  AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                  X       6.0827     0.0000     0.0000     6.0827     0.0000     0.0000 #--------
                  Y       3.1693     0.0000     0.0000     3.1693     0.0000     0.0000 #--------
                  Z       0.0000     0.0000     0.0000     0.0000     0.0000     0.0000 #--------
                  D       0.5906     0.0000     0.0000     0.5906     0.0000     0.0000 #--------
                  END OF DIMENSION LOC2
                  DIM LOC3= LOCATION OF CIRCLE TCIR3  UNITS=IN ,$
                  GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
                  AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                  X       6.0827     0.0000     0.0000     6.0827     0.0000     0.0000 #--------
                  Y       0.7677     0.0000     0.0000     0.7677     0.0000     0.0000 #--------
                  Z       0.0000     0.0000     0.0000     0.0000     0.0000     0.0000 #--------
                  D       0.5906     0.0000     0.0000     0.5906     0.0000     0.0000 #--------
                  END OF DIMENSION LOC3
                  DIM LOC4= LOCATION OF CIRCLE TCIR4  UNITS=IN ,$
                  GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
                  AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                  X       3.6811     0.0000     0.0000     3.6811     0.0000     0.0000 #--------
                  Y       0.7677     0.0000     0.0000     0.7677     0.0000     0.0000 #--------
                  Z       0.0000     0.0000     0.0000     0.0000     0.0000     0.0000 #--------
                  D       0.5906     0.0000     0.0000     0.5906     0.0000     0.0000 #--------
                  END OF DIMENSION LOC4
                              ENDSUB/
                            ENDGROUP/ID=PART#1_DIMS
                END        =LABEL/
                There's no need to build "FORREF1" with this method as you can address your dimensions to existing geometry in sub just make sure to go back and change name of feature geometry to "TCIR1" thru "TCIR4".
                Last edited by Kp61dude!; 01-07-2019, 09:32 AM.
                PcDmis 2015.1 SP10 CAD++
                Global 7-10-7 DC800S

                Comment


                • #9
                  Did this make sense to anyone?

                  Edit: I guess not haha...
                  Last edited by Kp61dude!; 01-09-2019, 08:49 AM.
                  PcDmis 2015.1 SP10 CAD++
                  Global 7-10-7 DC800S

                  Comment


                  • #10
                    Made sense to me but the parts we have here i will not need this. It looks like a great way to get the results that you need.
                    Time for the Trolls to leave.

                    Comment


                    • #11
                      Some how it makes sense, but You are still measuring 4 identical circles.
                      I was looking for a method on measuring one circle 4 times, or just 2 times.

                      Something like this:


                      PROGRAM =LABEL/
                      MODE/DCC
                      LOADPROBE/T1D2L40
                      TIP/T1A0B0, SHANKIJK=-0.174, 0.01, 0.985, ANGLE=-0.179
                      WORKPLANE/ZPLUS
                      CLEARP/ZPLUS,5,ZPLUS,5,OFF
                      MOVE/POINT,NORMAL,<-85,94,50>
                      MOVESPEED/ MEDIUM
                      PNT1 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                      THEO/<-85,94,20>,<0,0,1>
                      ACTL/<-85,94,20>,<0,0,1>
                      TARG/<-85,94,20>,<0,0,1>
                      SNAP=NO
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=BOTH,DISTANCE=5
                      SHOW HITS=YES
                      HIT/BASIC,<-85,94,20>,<0,0,1>,<-85,94,20>
                      ENDMEAS/
                      PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                      THEO/<-45,49,20>,<0,0,1>
                      ACTL/<-45,49,20>,<0,0,1>
                      TARG/<-45,49,20>,<0,0,1>
                      SNAP=NO
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=BOTH,DISTANCE=5
                      SHOW HITS=YES
                      HIT/BASIC,<-45,49,20>,<0,0,1>,<-45,49,20>
                      ENDMEAS/
                      PNT3 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                      THEO/<-85,4,20>,<0,0,1>
                      ACTL/<-85,4,20>,<0,0,1>
                      TARG/<-85,4,20>,<0,0,1>
                      SNAP=NO
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=BOTH,DISTANCE=5
                      SHOW HITS=YES
                      HIT/BASIC,<-85,4,20>,<0,0,1>,<-85,4,20>
                      ENDMEAS/
                      PLN1 =FEAT/PLANE,CARTESIAN,OUTLINE,NO
                      THEO/<-71.667,49,20>,<0,0,1>
                      ACTL/<-71.667,49,20>,<0,0,1>
                      CONSTR/PLANE,BF,PNT1,PNT2,PNT3,,
                      OUTLIER_REMOVAL/OFF,3
                      FILTER/OFF,WAVELENGTH=0
                      A1 =ALIGNMENT/START,RECALL:A1_VICE,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1
                      ALIGNMENT/TRANS,ZAXIS,PLN1
                      ALIGNMENT/END
                      CLEARP/ZPLUS,5,ZPLUS,5,OFF
                      MOVE/POINT,NORMAL,<-30,4,5>
                      PNT4 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                      THEO/<-40,4,-2>,<1,0,0>
                      ACTL/<-40,4,-2>,<1,0,0>
                      TARG/<-40,4,-2>,<1,0,0>
                      SNAP=NO
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=BOTH,DISTANCE=5
                      SHOW HITS=YES
                      HIT/BASIC,<-40,4,-2>,<1,0,0>,<-40,4,-2>
                      ENDMEAS/
                      PNT5 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                      THEO/<-40,94,-2>,<1,0,0>
                      ACTL/<-40,94,-2>,<1,0,0>
                      TARG/<-40,94,-2>,<1,0,0>
                      SNAP=NO
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=BOTH,DISTANCE=5
                      SHOW HITS=YES
                      HIT/BASIC,<-40,94,-2>,<1,0,0>,<-40,94,-2>
                      ENDMEAS/
                      LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                      THEO/<-40,4,-2>,<0,1,0>
                      ACTL/<-40,4,-2>,<0,1,0>
                      CONSTR/LINE,BF,3D,PNT4,PNT5,,
                      OUTLIER_REMOVAL/OFF,3
                      FILTER/OFF,WAVELENGTH=0
                      A2 =ALIGNMENT/START,RECALL:A1,LIST=YES
                      ALIGNMENT/ROTATE,YPLUS,TO,LIN1,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,XAXIS,LIN1
                      ALIGNMENT/END
                      MOVE/CLEARPLANE
                      MOVE/POINT,NORMAL,<-25,-55,5>
                      PNT6 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                      THEO/<-25,0,-2>,<0,-1,0>
                      ACTL/<-25,0,-2>,<0,-1,0>
                      TARG/<-25,0,-2>,<0,-1,0>
                      SNAP=NO
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      AVOIDANCE MOVE=BOTH,DISTANCE=5
                      SHOW HITS=YES
                      HIT/BASIC,<-25,0,-2>,<0,-1,0>,<-25,0,-2>
                      ENDMEAS/
                      A_PART =ALIGNMENT/START,RECALL:A1_VICE,LIST=YES
                      ALIGNMENT/LEVEL,ZPLUS,PLN1
                      ALIGNMENT/TRANS,ZAXIS,PLN1
                      ALIGNMENT/ROTATE,YPLUS,TO,LIN1,ABOUT,ZPLUS
                      ALIGNMENT/TRANS,XAXIS,LIN1
                      ALIGNMENT/TRANS,YAXIS,PNT6
                      ALIGNMENT/END
                      MOVE/CLEARPLANE
                      MOVE/POINT,NORMAL,<-25,25,5>
                      CYL_D20_A =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR
                      THEO/<-25,25,-12.375>,<0,0,1>,15,12.625
                      ACTL/<-25,25,-12.375>,<0,0,1>,15,12.625
                      TARG/<-25,25,-12.375>,<0,0,1>
                      START ANG=0,END ANG=360
                      ANGLE VEC=<0,0,-1>
                      DIRECTION=CCW
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      NUMHITS=4,NUMLEVELS=2,DEPTH=2,END OFFSET=2,PITCH=0
                      SAMPLE METHOD=SAMPLE_HITS
                      SAMPLE HITS=0,SPACER=3
                      AVOIDANCE MOVE=NO,DISTANCE=3
                      FIND HOLE=NOCENTER,ONERROR=NO,READ POS=NO
                      SHOW HITS=YES
                      HIT/BASIC,<-17.5,25,-23>,<-1,0,0>,<-17.5,25,-23>
                      HIT/BASIC,<-25,32.5,-23>,<0,-1,0>,<-25,32.5,-23>
                      HIT/BASIC,<-32.5,25,-23>,<1,0,0>,<-32.5,25,-23>
                      HIT/BASIC,<-25,17.5,-23>,<0,1,0>,<-25,17.5,-23>
                      HIT/BASIC,<-25,17.5,-14.375>,<0,1,0>,<-25,17.5,-14.375>
                      HIT/BASIC,<-32.5,25,-14.375>,<1,0,0>,<-32.5,25,-14.375>
                      HIT/BASIC,<-25,32.5,-14.375>,<0,-1,0>,<-25,32.5,-14.375>
                      HIT/BASIC,<-17.5,25,-14.375>,<-1,0,0>,<-17.5,25,-14.375>
                      ENDMEAS/
                      CON_D30_A =FEAT/CONTACT/CONE/DEFAULT,CARTESIAN,IN
                      THEO/<-25,25,0>,<0,0,1>,44,-12.375,30
                      ACTL/<-25,25,0>,<0,0,1>,44,-12.375,30
                      TARG/<-25,25,0>,<0,0,1>
                      START ANG=0,END ANG=360
                      ANGLE VEC=<0,0,1>
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=YES
                      NUMHITS=4,NUMLEVELS=2,DEPTH=2,END OFFSET=2
                      SAMPLE METHOD=SAMPLE_HITS
                      SAMPLE HITS=0,SPACER=3
                      AVOIDANCE MOVE=NO,DISTANCE=5
                      ONERROR=NO,READ POS=NO
                      SHOW HITS=YES
                      HIT/BASIC,<-10.808,25,-2>,<-0.9271839,0,0.3746066>,<-10.808,25,-2>
                      HIT/BASIC,<-25,39.192,-2>,<0,-0.9271839,0.3746066>,<-25,39.192,-2>
                      HIT/BASIC,<-39.192,25,-2>,<0.9271839,0,0.3746066>,<-39.192,25,-2>
                      HIT/BASIC,<-25,10.808,-2>,<0,0.9271839,0.3746066>,<-25,10.808,-2>
                      HIT/BASIC,<-25,14.192,-10.375>,<0,0.9271839,0.3746066>,<-25,14.192,-10.375>
                      HIT/BASIC,<-35.808,25,-10.375>,<0.9271839,0,0.3746066>,<-35.808,25,-10.375>
                      HIT/BASIC,<-25,35.808,-10.375>,<0,-0.9271839,0.3746066>,<-25,35.808,-10.375>
                      HIT/BASIC,<-14.192,25,-10.375>,<-0.9271839,0,0.3746066>,<-14.192,25,-10.375>
                      ENDMEAS/
                      MOVE/CLEARPLANE
                      MOVE/POINT,NORMAL,<-25,75,5>

                      Here it repeats HOLE-2 and CONE-2

                      MOVE/CLEARPLANE
                      MOVESPEED/ FAST
                      MOVE/POINT,NORMAL,<-25,250,400>



                      The report would look like this

                      COMMENT/REPT,
                      ~~1 INFORMATION:
                      There are 2 cylinders (HOLE-1 & HOLE-2), and there are 2 cones (CONE-1 & CONE-2)
                      The cylinders are ø20 and goes from a depth of Z-20 to Z-12.375
                      The cones starts down in Z-12.375 and goes up to Z0
                      The diameter in Z-12.375 is ø20, and at Z0 the diameter is ø30, so the angle is 22°

                      COMMENT/REPT,
                      Position of HOLE-1.
                      DIM LOC1= LOCATION OF CYLINDER CYL_D20_A UNITS=MM ,$
                      GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
                      AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
                      X -25.000+0 0.500 -0.500 -25.000 0.000 0.000 -#--
                      Y 25.000+0 0.500 -0.500 25.000 0.000 0.000 -#--
                      D 15.000+0 0.500 -0.500 15.000 0.000 0.000 -#--
                      END OF DIMENSION LOC1
                      COMMENT/REPT,
                      Position of CONE-1.
                      DIM LOC2= LOCATION OF CONE CON_D30_A UNITS=MM ,$
                      GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
                      AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
                      X -25.000+0 0.500 -0.500 -25.000 0.000 0.000 -#--
                      Y 25.000+0 0.500 -0.500 25.000 0.000 0.000 -#--
                      D 30.000+0 0.500 -0.500 30.000 0.000 0.000 -#--
                      A 44.000+0 0.500 -0.500 44.000 0.000 0.000 -#--
                      L -12.375+0 0.500 -0.500 -12.375 0.000 0.000 -#--
                      END OF DIMENSION LOC2

                      And the same for HOLE-2 and CONE-2

                      But where the cylinder and cone are put in a sub-routine, and the values from them, are "transferred" back to the main program.

                      That was my issue.
                      How can I do that?

                      How do I "tell" the sub-routine the position of the features?
                      Do I have to "rename" the data from the subroutine when the features are measured?
                      Last but not least, how do I separate the data from the 2 sets of data.

                      Does that make sense?
                      Best regards

                      Michael
                      -- o --
                      DEA Global - 09-15-08
                      Renishaw PH10MQ w/ TP200 & SCR200-Rack
                      PC-DMIS CAD Ver. 2017 R2 / PC-DMIS 2011 MR1

                      Comment


                      • #12
                        Simple.

                        Throw your feature/s in your sub routine and from your part program call that sub as many times as you'd like. Now on the dimension side, you have to choose a method as there's many. I would personally go with example on post #5 "Geometry in Subroutine, Dimensions in part routine method."

                        Post your code within the appropriate tags, makes it easier to view it, like this:

                        Code:
                        PROGRAM =LABEL/
                        MODE/DCC
                        LOADPROBE/T1D2L40
                        TIP/T1A0B0, SHANKIJK=-0.174, 0.01, 0.985, ANGLE=-0.179
                        WORKPLANE/ZPLUS
                        CLEARP/ZPLUS,5,ZPLUS,5,OFF
                        MOVE/POINT,NORMAL,<-85,94,50>
                        MOVESPEED/ MEDIUM
                        PNT1 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-85,94,20>,<0,0,1>
                        ACTL/<-85,94,20>,<0,0,1>
                        TARG/<-85,94,20>,<0,0,1>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        AVOIDANCE MOVE=BOTH,DISTANCE=5
                        SHOW HITS=YES
                        HIT/BASIC,<-85,94,20>,<0,0,1>,<-85,94,20>
                        ENDMEAS/
                        PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-45,49,20>,<0,0,1>
                        ACTL/<-45,49,20>,<0,0,1>
                        TARG/<-45,49,20>,<0,0,1>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        AVOIDANCE MOVE=BOTH,DISTANCE=5
                        SHOW HITS=YES
                        HIT/BASIC,<-45,49,20>,<0,0,1>,<-45,49,20>
                        ENDMEAS/
                        PNT3 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-85,4,20>,<0,0,1>
                        ACTL/<-85,4,20>,<0,0,1>
                        TARG/<-85,4,20>,<0,0,1>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        AVOIDANCE MOVE=BOTH,DISTANCE=5
                        SHOW HITS=YES
                        HIT/BASIC,<-85,4,20>,<0,0,1>,<-85,4,20>
                        ENDMEAS/
                        PLN1 =FEAT/PLANE,CARTESIAN,OUTLINE,NO
                        THEO/<-71.667,49,20>,<0,0,1>
                        ACTL/<-71.667,49,20>,<0,0,1>
                        CONSTR/PLANE,BF,PNT1,PNT2,PNT3,,
                        OUTLIER_REMOVAL/OFF,3
                        FILTER/OFF,WAVELENGTH=0
                        A1 =ALIGNMENT/START,RECALL:A1_VICE,LIST=YES
                        ALIGNMENT/LEVEL,ZPLUS,PLN1
                        ALIGNMENT/TRANS,ZAXIS,PLN1
                        ALIGNMENT/END
                        CLEARP/ZPLUS,5,ZPLUS,5,OFF
                        MOVE/POINT,NORMAL,<-30,4,5>
                        PNT4 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-40,4,-2>,<1,0,0>
                        ACTL/<-40,4,-2>,<1,0,0>
                        TARG/<-40,4,-2>,<1,0,0>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        AVOIDANCE MOVE=BOTH,DISTANCE=5
                        SHOW HITS=YES
                        HIT/BASIC,<-40,4,-2>,<1,0,0>,<-40,4,-2>
                        ENDMEAS/
                        PNT5 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-40,94,-2>,<1,0,0>
                        ACTL/<-40,94,-2>,<1,0,0>
                        TARG/<-40,94,-2>,<1,0,0>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        AVOIDANCE MOVE=BOTH,DISTANCE=5
                        SHOW HITS=YES
                        HIT/BASIC,<-40,94,-2>,<1,0,0>,<-40,94,-2>
                        ENDMEAS/
                        LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                        THEO/<-40,4,-2>,<0,1,0>
                        ACTL/<-40,4,-2>,<0,1,0>
                        CONSTR/LINE,BF,3D,PNT4,PNT5,,
                        OUTLIER_REMOVAL/OFF,3
                        FILTER/OFF,WAVELENGTH=0
                        A2 =ALIGNMENT/START,RECALL:A1,LIST=YES
                        ALIGNMENT/ROTATE,YPLUS,TO,LIN1,ABOUT,ZPLUS
                        ALIGNMENT/TRANS,XAXIS,LIN1
                        ALIGNMENT/END
                        MOVE/CLEARPLANE
                        MOVE/POINT,NORMAL,<-25,-55,5>
                        PNT6 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-25,0,-2>,<0,-1,0>
                        ACTL/<-25,0,-2>,<0,-1,0>
                        TARG/<-25,0,-2>,<0,-1,0>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        AVOIDANCE MOVE=BOTH,DISTANCE=5
                        SHOW HITS=YES
                        HIT/BASIC,<-25,0,-2>,<0,-1,0>,<-25,0,-2>
                        ENDMEAS/
                        A_PART =ALIGNMENT/START,RECALL:A1_VICE,LIST=YES
                        ALIGNMENT/LEVEL,ZPLUS,PLN1
                        ALIGNMENT/TRANS,ZAXIS,PLN1
                        ALIGNMENT/ROTATE,YPLUS,TO,LIN1,ABOUT,ZPLUS
                        ALIGNMENT/TRANS,XAXIS,LIN1
                        ALIGNMENT/TRANS,YAXIS,PNT6
                        ALIGNMENT/END
                        MOVE/CLEARPLANE
                        MOVE/POINT,NORMAL,<-25,25,5>
                        
                        Delete from here to....
                        CYL_D20_A =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR
                        THEO/<-25,25,-12.375>,<0,0,1>,15,12.625
                        ACTL/<-25,25,-12.375>,<0,0,1>,15,12.625
                        TARG/<-25,25,-12.375>,<0,0,1>
                        START ANG=0,END ANG=360
                        ANGLE VEC=<0,0,-1>
                        DIRECTION=CCW
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        NUMHITS=4,NUMLEVELS=2,DEPTH=2,END OFFSET=2,PITCH=0
                        SAMPLE METHOD=SAMPLE_HITS
                        SAMPLE HITS=0,SPACER=3
                        AVOIDANCE MOVE=NO,DISTANCE=3
                        FIND HOLE=NOCENTER,ONERROR=NO,READ POS=NO
                        SHOW HITS=YES
                        HIT/BASIC,<-17.5,25,-23>,<-1,0,0>,<-17.5,25,-23>
                        HIT/BASIC,<-25,32.5,-23>,<0,-1,0>,<-25,32.5,-23>
                        HIT/BASIC,<-32.5,25,-23>,<1,0,0>,<-32.5,25,-23>
                        HIT/BASIC,<-25,17.5,-23>,<0,1,0>,<-25,17.5,-23>
                        HIT/BASIC,<-25,17.5,-14.375>,<0,1,0>,<-25,17.5,-14.375>
                        HIT/BASIC,<-32.5,25,-14.375>,<1,0,0>,<-32.5,25,-14.375>
                        HIT/BASIC,<-25,32.5,-14.375>,<0,-1,0>,<-25,32.5,-14.375>
                        HIT/BASIC,<-17.5,25,-14.375>,<-1,0,0>,<-17.5,25,-14.375>
                        ENDMEAS/
                        CON_D30_A =FEAT/CONTACT/CONE/DEFAULT,CARTESIAN,IN
                        THEO/<-25,25,0>,<0,0,1>,44,-12.375,30
                        ACTL/<-25,25,0>,<0,0,1>,44,-12.375,30
                        TARG/<-25,25,0>,<0,0,1>
                        START ANG=0,END ANG=360
                        ANGLE VEC=<0,0,1>
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=YES
                        NUMHITS=4,NUMLEVELS=2,DEPTH=2,END OFFSET=2
                        SAMPLE METHOD=SAMPLE_HITS
                        SAMPLE HITS=0,SPACER=3
                        AVOIDANCE MOVE=NO,DISTANCE=5
                        ONERROR=NO,READ POS=NO
                        SHOW HITS=YES
                        HIT/BASIC,<-10.808,25,-2>,<-0.9271839,0,0.3746066>,<-10.808,25,-2>
                        HIT/BASIC,<-25,39.192,-2>,<0,-0.9271839,0.3746066>,<-25,39.192,-2>
                        HIT/BASIC,<-39.192,25,-2>,<0.9271839,0,0.3746066>,<-39.192,25,-2>
                        HIT/BASIC,<-25,10.808,-2>,<0,0.9271839,0.3746066>,<-25,10.808,-2>
                        HIT/BASIC,<-25,14.192,-10.375>,<0,0.9271839,0.3746066>,<-25,14.192,-10.375>
                        HIT/BASIC,<-35.808,25,-10.375>,<0.9271839,0,0.3746066>,<-35.808,25,-10.375>
                        HIT/BASIC,<-25,35.808,-10.375>,<0,-0.9271839,0.3746066>,<-25,35.808,-10.375>
                        HIT/BASIC,<-14.192,25,-10.375>,<-0.9271839,0,0.3746066>,<-14.192,25,-10.375>
                        ENDMEAS/
                        ... Delete to here.
                        
                        
                        ******Call sub routine here SubroutineTest(X,Y,Z)
                        
                        
                        MOVE/CLEARPLANE
                        MOVE/POINT,NORMAL,<-25,75,5>
                        
                        Here it repeats HOLE-2 and CONE-2
                        
                        ******Call sub routine here SubroutineTest(X,Y,Z)
                        
                        MOVE/CLEARPLANE
                        MOVESPEED/ FAST
                        MOVE/POINT,NORMAL,<-25,250,400>
                        
                        
                        
                        The report would look like this
                        
                        COMMENT/REPT,
                        ~~1 INFORMATION:
                        There are 2 cylinders (HOLE-1 & HOLE-2), and there are 2 cones (CONE-1 & CONE-2)
                        The cylinders are ø20 and goes from a depth of Z-20 to Z-12.375
                        The cones starts down in Z-12.375 and goes up to Z0
                        The diameter in Z-12.375 is ø20, and at Z0 the diameter is ø30, so the angle is 22°
                        
                        When you dimension your features here follow example from post #5 to replace "CYL_D20" with the same naming convention in post #5.
                        
                        COMMENT/REPT,
                        Position of HOLE-1.
                        DIM LOC1= LOCATION OF CYLINDER CYL_D20_A UNITS=MM ,$
                        GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
                        AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
                        X -25.000+0 0.500 -0.500 -25.000 0.000 0.000 -#--
                        Y 25.000+0 0.500 -0.500 25.000 0.000 0.000 -#--
                        D 15.000+0 0.500 -0.500 15.000 0.000 0.000 -#--
                        END OF DIMENSION LOC1
                        COMMENT/REPT,
                        Position of CONE-1.
                        DIM LOC2= LOCATION OF CONE CON_D30_A UNITS=MM ,$
                        GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
                        AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
                        X -25.000+0 0.500 -0.500 -25.000 0.000 0.000 -#--
                        Y 25.000+0 0.500 -0.500 25.000 0.000 0.000 -#--
                        D 30.000+0 0.500 -0.500 30.000 0.000 0.000 -#--
                        A 44.000+0 0.500 -0.500 44.000 0.000 0.000 -#--
                        L -12.375+0 0.500 -0.500 -12.375 0.000 0.000 -#--
                        END OF DIMENSION LOC2
                        Last edited by Kp61dude!; 01-15-2019, 04:59 PM.
                        PcDmis 2015.1 SP10 CAD++
                        Global 7-10-7 DC800S

                        Comment


                        • Mykel
                          Mykel commented
                          Editing a comment
                          A quick one:
                          How do I put the program in tags?

                        • Kp61dude!
                          Kp61dude! commented
                          Editing a comment
                          What are tags?

                        • Mykel
                          Mykel commented
                          Editing a comment
                          Well, the tags that You mensioned, I should put my program in, when posting them in the forum.

                      • #13
                        Part routine call would look like this:
                        Code:
                        CS1 =CALLSUB/PART1_GEO,C:\Users\Public\Documents\WAI\PC-DMIS\2015.1\Subroutines\Subroutine_Dimensions.PRG:0,0,-.065,2.5,,
                        Subroutine like this:
                        Code:
                        SUBROUTINE/PART1_GEO,
                                        MYX =  : <-- THATS THE VARIABLE. INPUT VARIABLE(THIS HERE IS A COMMENT),
                                        MYY =  : INPUT VARIABLE,
                                        MYZ =  : INPUT VALRIABLE,
                                        MYI =  : INPUT VARIABLE,
                                        MYJ =  : INPUT VARIABLE,
                                        MYK =  : INPUT VARIABLE,
                                        MYDIA =  : INPUT VARIABLE,
                                         =
                        CYL6       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,MIN_CIRCSC
                                    THEO/<MYX,MYY,MYZ>,<MYI,MYJ,MYK>,MYDIA
                                    ACTL/<0,0,0>,<0,0,0>,0
                                    TARG/<MYX,MYY,MYZ>,<MYI,MYJ,MYK>
                                    START ANG=0,END ANG=360
                                    ANGLE VEC=<1,0,0>
                                    DIRECTION=CCW
                                    SHOW FEATURE PARAMETERS=NO
                                    SHOW CONTACT PARAMETERS=YES
                                      NUMHITS=4,DEPTH=0.9,PITCH=0
                                      SAMPLE METHOD=SAMPLE_HITS
                                      SAMPLE HITS=0,SPACER=0
                                      AVOIDANCE MOVE=NO,DISTANCE=0
                                      FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                                    SHOW HITS=NO
                                    ENDSUB/
                        this would measure a circle at X: 0, Y: 0, Z: -.065, D:2.5

                        The more inputs in a feature the more variables you'll need to define everything if you want something other than default.
                        PcDmis 2015.1 SP10 CAD++
                        Global 7-10-7 DC800S

                        Comment


                        • Kp61dude!
                          Kp61dude! commented
                          Editing a comment
                          Cool! You're welcome.

                        • davehocum
                          davehocum commented
                          Editing a comment
                          Kp61dude!, Thank you for the detail Subroutine method.

                        • Kp61dude!
                          Kp61dude! commented
                          Editing a comment
                          Glad to davehocum

                      • #14
                        Hi,
                        is it correct to say that the alignment used in the sub routine is the one that is valid in the part routine when it reaches the callsub command?

                        Comment


                        • #15
                          I'd just do this with simple flow controls: If_goto with labels to skip/omit measuring features.

                          Comment


                          • Kp61dude!
                            Kp61dude! commented
                            Editing a comment
                            Ditto! ...

                          • davehocum
                            davehocum commented
                            Editing a comment
                            This is the way I would create this type of measurement routine.

                        Related Topics

                        Collapse

                        Working...
                        X