Printing Variables!

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

  • Printing Variables!

    I need to do some calculations and print them out from variables as dimensions or to the report. Never really messed with variables so any help will be appreciated! Thanks ahead of time.
    I used to be high on life but I built up a tolerance.

    Brown & Sharpe Global Advantage
    PCDMIS CAD++ v2011mr2
    PH10MQ/SP600M


    sigpic

  • #2
    What exactly do you want to do and I'll post some code?

    for example:

    Code:
    F2_900_DIA =FEAT/CIRCLE,RECT,IN,LEAST_SQR
                THEO/0,0,1.8,0,0,-1,2.9035
                ACTL/-0.0014,0.0008,1.8013,0,0,1,2.9042
                MEAS/CIRCLE,8,WORKPLANE
                HIT/BASIC,0,1.4517,1.8,0,-1,0,-0.0004,1.4527,1.8011
                HIT/BASIC,1.0265,1.0265,1.8,-0.7071068,-0.7071068,0,1.0273,1.0261,1.8012
                HIT/BASIC,1.4517,0,1.8,-1,0,0,1.4506,0.0006,1.8014
                HIT/BASIC,1.0265,-1.0265,1.8,-0.7071068,0.7071068,0,1.0263,-1.0247,1.8015
                HIT/BASIC,0,-1.4517,1.8,0,1,0,-0.0009,-1.4513,1.8015
                HIT/BASIC,-1.0265,-1.0265,1.8,0.7071068,0.7071068,0,-1.0276,-1.0266,1.8014
                HIT/BASIC,-1.4517,0,1.8,1,0,0,-1.4536,-0.0009,1.8012
                HIT/BASIC,-1.0265,1.0265,1.8,0.7071068,-0.7071068,0,-1.0284,1.0271,1.8011
                ENDMEAS/
                ASSIGN/F2900DIA = F2_900_DIA.D
                COMMENT/REPT,F2900DIA
    Will print the variable F2900DIA which is the diameter of the F2_900_DIA feature. But so will:

    Code:
    F2_900_DIA =FEAT/CIRCLE,RECT,IN,LEAST_SQR
                THEO/0,0,1.8,0,0,-1,2.9035
                ACTL/-0.0014,0.0008,1.8013,0,0,1,2.9042
                MEAS/CIRCLE,8,WORKPLANE
                HIT/BASIC,0,1.4517,1.8,0,-1,0,-0.0004,1.4527,1.8011
                HIT/BASIC,1.0265,1.0265,1.8,-0.7071068,-0.7071068,0,1.0273,1.0261,1.8012
                HIT/BASIC,1.4517,0,1.8,-1,0,0,1.4506,0.0006,1.8014
                HIT/BASIC,1.0265,-1.0265,1.8,-0.7071068,0.7071068,0,1.0263,-1.0247,1.8015
                HIT/BASIC,0,-1.4517,1.8,0,1,0,-0.0009,-1.4513,1.8015
                HIT/BASIC,-1.0265,-1.0265,1.8,0.7071068,0.7071068,0,-1.0276,-1.0266,1.8014
                HIT/BASIC,-1.4517,0,1.8,1,0,0,-1.4536,-0.0009,1.8012
                HIT/BASIC,-1.0265,1.0265,1.8,0.7071068,-0.7071068,0,-1.0284,1.0271,1.8011
                ENDMEAS/
                COMMENT/REPT,F2_900_DIA.D
    This is the variable assignment:
    Code:
    ASSIGN/F2900DIA = F2_900_DIA.D
    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      You can add them to a generic feature and dimension it that way
      sigpic
      if you had soap on a rope it would be tied to yer ankle

      Comment


      • #4
        Originally posted by T Miller
        You can add them to a generic feature and dimension it that way
        The possibilities and applications are endless. What do you want to do?
        <internet bumper sticker goes here>

        Comment


        • #5
          I need to take a distance and use that to subtract from 7. Then dimension it somehow. I do not wish to have the COMMENT show in the report. I plan on printing to a text file.
          I used to be high on life but I built up a tolerance.

          Brown & Sharpe Global Advantage
          PCDMIS CAD++ v2011mr2
          PH10MQ/SP600M


          sigpic

          Comment


          • #6
            Use the "-" operator to subtract the distance in your dimension from 7 then use the file open, and file write commands to write the variable to the text file.

            Code:
            DIM GENERIC_DIMENSION= LOCATION OF POINT GENERIC  UNITS=IN ,$
            GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
            AX    MEAS   NOMINAL    +TOL     -TOL      DEV    OUTTOL 
            X    2.9042   2.9035   0.0050   0.0050   0.0007   0.0000 -----#---
            END OF DIMENSION GENERIC_DIMENSION
            ASSIGN/VARIABLETOWRITE = 7 - GENERIC_DIMENSION.X.MEAS
            FPTR       =FILE/OPEN,C:\Documents and Settings\Administrator\Desktop\ExportedPoints.txt,WRITE
            V1         =FILE/WRITELINE,FPTR,VARIABLETOWRITE
                        FILE/CLOSE,FPTR
            I'm not at a CMM right now so I pieced that together from a text file so I'm not possitive that is exactly it but should get you on the right track.

            BTW how do you export .prg as a BAS like you said you could do in another post?

            Craig
            Last edited by craiger_ny; 08-09-2006, 03:13 PM.
            <internet bumper sticker goes here>

            Comment


            • #7
              Originally posted by craiger_ny
              BTW how do you export .prg as a BAS like you said you could do in another post?

              Craig
              Not sure if this is what he was talking about but... You can go file-export-basic and save a file as a .bas file.

              Comment


              • #8
                the value I need is a plane to plane distance which is subtracted from 7. I need it on the report which I am printing to a RTF file.
                I used to be high on life but I built up a tolerance.

                Brown & Sharpe Global Advantage
                PCDMIS CAD++ v2011mr2
                PH10MQ/SP600M


                sigpic

                Comment


                • #9
                  Here ya go:


                  DIM D53= 2D DISTANCE FROM POINT B9 TO POINT B8 PAR TO YAXIS, NO_RADIUS UNITS=MM ,$
                  GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
                  AX MEAS NOMINAL +TOL -TOL DEV MAX MIN OUTTOL
                  M 12.120 12.120 0.025 0.025 0.000 12.120 12.120 0.000 ----#----
                  ASSIGN/V1 = D53.MEAS
                  ASSIGN/V2 = 7-V1
                  GEN_POINT =GENERIC/POINT,DEPENDENT,RECT,$
                  NOM/XYZ,0,0,-4,$
                  MEAS/XYZ,0,0,V2,$
                  NOM/IJK,0,0,1,$
                  MEAS/IJK,0,0,1
                  DIM D54= LOCATION OF POINT GEN_POINT UNITS=MM ,$
                  GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
                  AX MEAS NOMINAL +TOL -TOL DEV MAX MIN OUTTOL
                  Z -5.120 -4.000 1.500 1.500 -1.120 -5.120 -5.120 0.000 -#-------
                  END OF DIMENSION D54
                  sigpic
                  Originally posted by AndersI
                  I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

                  Comment


                  • #10
                    ASSIGN/V1 = PLN18.X - PLN17.X
                    ASSIGN/V2 = 7 - V1
                    create a generic feature point and put v2 where the x value should be
                    sigpic
                    if you had soap on a rope it would be tied to yer ankle

                    Comment


                    • #11
                      Nevermind I used your comment method and works great!! Thanks!
                      I used to be high on life but I built up a tolerance.

                      Brown & Sharpe Global Advantage
                      PCDMIS CAD++ v2011mr2
                      PH10MQ/SP600M


                      sigpic

                      Comment

                      Related Topics

                      Collapse

                      • #2#
                        Constructed Circle Problem
                        by #2#
                        Can anyone tell me why the Cir8 is way out in space?

                        Code:
                        CIR7       =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = YES
                                    THEO/0,0,-0.3,0,0,1,0.313,0.2
                        ...
                        05-30-2008, 11:43 AM
                      • Wingman
                        3.73 Still not right??
                        by Wingman
                        A while back I posted some weird issues with 3.73. I thought I had it solved by figuring out that 3.73 doesn't really like 3.72. Now it appears the...
                        07-26-2007, 10:39 AM
                      • drako28
                        High Point Extraction ?
                        by drako28
                        I'm trying to find the high point of this scan. I'm using 4.1. Is there something I'm missing? I am only getting the first number out of the scan....
                        11-30-2006, 09:56 AM
                      • #2#
                        Losing Alignment on Angle Change?
                        by #2#
                        Alright, here is my code. The first bit here is with A0B0. Just before the last move point it changes to A90B180.

                        Code:
                         DATUM_B    =AUTO/CYLINDER,SHOWALLPARAMS
                        ...
                        06-07-2007, 04:34 PM
                      • mr500
                        Why Is My
                        by mr500
                        Why is my program stopping in the middle of the run. I have marked where it is stoping in the code. UGHHHHH

                        Code:
                        PLN2
                        ...
                        08-18-2008, 03:11 PM
                      Working...
                      X