hexagon logo

Export XYZ points of Scan

I have a program with 8 linear open scans in which the alignment is rotating for each scan. Currently I have manually doing an Export:Generic for each alignment to capture the correct XYZ data for the 8 scans. There is approximately 350 points in each scan. Is there an easier way to do this?
Parents
  • I am a bit of an odd duck, but 90% of my measurements are scans (since I do mostly surface work). I need to export the individual scans under several different datum conditions. To do this, I have created my own CSV format and an Excel script that will parse out the individual features as I need them of more detailed analysis or plotting. In the case that I want to save all the scans at once under a given datum condition, I use the Export operator on a COP containing all the scans.

    To print the data to CSV, I format all the points into an array and write that entire array, as a single line to a text file. This will allow PC-DMIS to write tens of thousands of points in a second, rather than minutes if you use looping. I have a boiler plate section of code that I copy and paste into the end of my program after I create the CSV file and headers. My Excel script separates the terms of the array into individual rows, then transposes them into columns (I work in columns for Minitab). It also creates a list of every scan in the file, so I can choose which parts and which scans to export for analysis in Minitab. It was a couple of days of work to set up (years ago for a different machine), but it is something I use on a daily basis and has saved me hours.

    Boiler plate scan export example for X, Y, Z, TZ. The first line is a header for the scan with the scan name, alignment, assembly state, part number and material. The second line is all the data as an array.
    $$ NO,
                ******* New Feature Export ********
                RECALL/ALIGNMENT,INTERNAL,4pt_Surface_ALGN
                ASSIGN/FNAME={L_EDGE}
                ASSIGN/FNAMETXT="L_Edge_Scn"
                ASSIGN/ALGNID="4pt_Surface"
                ASSIGN/ASSY_TXT=ASSY.INPUT
                ASSIGN/PARTID=PARTID.INPUT
                FILE/WRITELINE,OUTFILE,
                FILE/WRITELINE,OUTFILE,
                FILE/WRITELINE,OUTFILE,FNAMETXT + "," + ALGNID + "," + ASSY_TXT + "," + PARTID.INPUT + ",Material"
                ASSIGN/POINTS=ARRAY(FNAME.HIT[1..FNAME.NUMHITS].X,FNAME.HIT[1..FNAME.NUMHITS].Y,FNAME.HIT[1..FNAME.NUMHITS].Z,FNAME.HIT[1..FNAME.NUMHITS].TZ)
                FILE/WRITE_BLOCK,OUTFILE,POINTS
    $$ NO,
                `````````` End Feature Export ``````````


    After the data are all written to file, I open the .csv as a text string in VBA, replace all the line and field delimiting characters like ") (", write that to a new Excel sheet, then take that again and transpose it into columns in the final sheet.

    It's all a pain in the butt to set up in code- once. It saves me hundreds of hours per year in machine time and data analysis/presentation time. My part throughput on the machine would be decreased by ~50% if I were doing the same thing with looping in PC-DMIS. Instead, I use each software tool for what it is best suited and things work very quickly.
Reply
  • I am a bit of an odd duck, but 90% of my measurements are scans (since I do mostly surface work). I need to export the individual scans under several different datum conditions. To do this, I have created my own CSV format and an Excel script that will parse out the individual features as I need them of more detailed analysis or plotting. In the case that I want to save all the scans at once under a given datum condition, I use the Export operator on a COP containing all the scans.

    To print the data to CSV, I format all the points into an array and write that entire array, as a single line to a text file. This will allow PC-DMIS to write tens of thousands of points in a second, rather than minutes if you use looping. I have a boiler plate section of code that I copy and paste into the end of my program after I create the CSV file and headers. My Excel script separates the terms of the array into individual rows, then transposes them into columns (I work in columns for Minitab). It also creates a list of every scan in the file, so I can choose which parts and which scans to export for analysis in Minitab. It was a couple of days of work to set up (years ago for a different machine), but it is something I use on a daily basis and has saved me hours.

    Boiler plate scan export example for X, Y, Z, TZ. The first line is a header for the scan with the scan name, alignment, assembly state, part number and material. The second line is all the data as an array.
    $$ NO,
                ******* New Feature Export ********
                RECALL/ALIGNMENT,INTERNAL,4pt_Surface_ALGN
                ASSIGN/FNAME={L_EDGE}
                ASSIGN/FNAMETXT="L_Edge_Scn"
                ASSIGN/ALGNID="4pt_Surface"
                ASSIGN/ASSY_TXT=ASSY.INPUT
                ASSIGN/PARTID=PARTID.INPUT
                FILE/WRITELINE,OUTFILE,
                FILE/WRITELINE,OUTFILE,
                FILE/WRITELINE,OUTFILE,FNAMETXT + "," + ALGNID + "," + ASSY_TXT + "," + PARTID.INPUT + ",Material"
                ASSIGN/POINTS=ARRAY(FNAME.HIT[1..FNAME.NUMHITS].X,FNAME.HIT[1..FNAME.NUMHITS].Y,FNAME.HIT[1..FNAME.NUMHITS].Z,FNAME.HIT[1..FNAME.NUMHITS].TZ)
                FILE/WRITE_BLOCK,OUTFILE,POINTS
    $$ NO,
                `````````` End Feature Export ``````````


    After the data are all written to file, I open the .csv as a text string in VBA, replace all the line and field delimiting characters like ") (", write that to a new Excel sheet, then take that again and transpose it into columns in the final sheet.

    It's all a pain in the butt to set up in code- once. It saves me hundreds of hours per year in machine time and data analysis/presentation time. My part throughput on the machine would be decreased by ~50% if I were doing the same thing with looping in PC-DMIS. Instead, I use each software tool for what it is best suited and things work very quickly.
Children
No Data