hexagon logo

Customizing Excel sheets

I am trying to output the data into an excel sheet but there are a few things that i need to make it work for what i am trying to do. We run three parts per hour and we have about 15 measurements per part. How can i create an excel sheet that will have left column as the dimension id, then the measured values for each dimensions on the second column and continues for every part there after.

3/22/2016 6:00A 3/22/2016 7:00A 3/22/2016 8:00A 3/22/2016 9:00A 3/22/2016 10:00A ETC…
HEIGHT A 0.153 0.155 0.156 0.154 0.153 ETC…
HEIGHT B 2.65 2.66 2.64 2.6 2.63 ETC…
HEIGHT C 1.35 1.36 1.33 1.35 1.33 ETC…
DIAMETER A 0.296 0.302 0.301 0.299 0.264 ETC…
DIAMETER B 0.034 0.034 0.036 0.033 0.033 ETC…
DIAMETER C 0.0296 0.024 0.026 0.025 0.024 ETC…

PLEASE HELP....
  • There are multiple way to export to Excel and there are a multitude of threads on this subject.

    You can either run a script, use PCD2Excel, or export as a CSV.
  • There are multiple way to export to Excel and there are a multitude of threads on this subject.

    You can either run a script, use PCD2Excel, or export as a CSV.


    I tried looking everywhere for ways to customize Excel sheet but was unable to, thats really why i am asking. I have played with the options in the excel sheet output menu but still nothing. I wasnt able to get anywhere thats why i am asking. Can anyone point me in the right direction?
  • When I get to the CMM today, I'll describe how I create a customized CSV that will append itself. The way I do it doesn't append going to the left, like you want, but it will append going down.
  • The easiest way is to automate from Excel - instead of PC-DMIS pushing data into Excel without knowing where to put it, you let Excel pull data from PC-DMIS and put it in the right place. We (Hexagon Metrology Nordic AB, Sweden) have made an Excel sheet that does what you want, but I don't know if we sell (or are allowed to sell) overseas... Check with marketing.se@hexagonmetrology.com if you're interested.

    The VBA in Excel is very like PC-DMIS Basic, so if you have a Basic script exporting the data you want, it should be quite easy to use almost the same code in Exel instead, just adding code for putting it in the right cell.
  • File I/O with writeline can give you a customized format that you're looking for.
  • Im not too knowledgeable at writing code (itd be nice to learn). Is there a more direct way (easy) to let the report fall into place?
  • Yes. This is what I would do. I typically use CSV's for stuff like this.

    Create a CSV file from Excel, save it into a location where you know it will be. Within each cell create these as your headers:

    Date | Time | Height A | Height B | Height C | Diameter A | Diameter B | Diameter C

    Save the CSV and Close it.

    Then in your program do this:

    FPTR       =FILE/OPEN,M:\Quality\CMM - Plex Data Import\Blank CSV Template.csv,APPEND
    CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<0,0,0.1>,<0,0,1>,0.25
                ACTL/<0,0,0.1>,<0,0,1>,0.25
                TARG/<0,0,0.1>,<0,0,1>
                START ANG=0,END ANG=360
                ANGLE VEC=<0,1,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
    CIR2       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<0,0,0.2>,<0,0,1>,0.3
                ACTL/<0,0,0.2>,<0,0,1>,0.3
                TARG/<0,0,0.2>,<0,0,1>
                START ANG=0,END ANG=360
                ANGLE VEC=<0,1,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
    CIR3       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<0,0,0.3>,<0,0,1>,0.35
                ACTL/<0,0,0.3>,<0,0,1>,0.35
                TARG/<0,0,0.3>,<0,0,1>
                START ANG=0,END ANG=360
                ANGLE VEC=<0,1,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
    DIM LOC1= LOCATION OF CIRCLE CIR1  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV     OUTTOL
    Z       0.1000     0.1000     0.1000     0.1000     0.0000     0.0000 ---#----
    D       0.2500     0.2500     0.1000     0.1000     0.0000     0.0000 ---#----
    END OF DIMENSION LOC1
    DIM LOC2= LOCATION OF CIRCLE CIR2  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV     OUTTOL
    Z       0.2000     0.2000     0.1000     0.1000     0.0000     0.0000 ---#----
    D       0.3000     0.3000     0.1000     0.1000     0.0000     0.0000 ---#----
    END OF DIMENSION LOC2
    DIM LOC3= LOCATION OF CIRCLE CIR3  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV     OUTTOL
    Z       0.3000     0.3000     0.1000     0.1000     0.0000     0.0000 ---#----
    D       0.3500     0.3500     0.1000     0.1000     0.0000     0.0000 ---#----
    END OF DIMENSION LOC3
                ASSIGN/SYSDAT=SYSTEMDATE("MMMM dd yyyy")
                ASSIGN/SYSTIM=SYSTEMTIME("HH:mm:ss")
                ASSIGN/V1=SYSDAT+","+SYSTIM
                ASSIGN/V2=LOC1.Z.MEAS+","+LOC2.Z.MEAS+","+LOC3.Z.MEAS
                ASSIGN/V3=LOC1.D.MEAS+","+LOC2.D.MEAS+","+LOC3.D.MEAS
                ASSIGN/V4=V1+","+V2+","+V3
                FILE/WRITELINE,FPTR,V4
                FILE/CLOSE,FPTR,KEEP
    


    Your FILE I/O commands are in Insert - FILE I/O Command... this is where the File Open, File Close, Write Line, etc are located. Hope this helps.
  • This is working great!! thank you so much, i created a dummy program (with a loop of 100 times) and ran a test of it and its working like a charm... thank you once again, i really appreciate your help.
  • This is working great!! thank you so much, i created a dummy program (with a loop of 100 times) and ran a test of it and its working like a charm... thank you once again, i really appreciate your help.


    Great to hear!