hexagon logo

macro or script to autorun PCD2Excel

Does anyone know how to write a script or macro to auto generate a report at the end of my program?

I know I can use
EXTERNALCOMMAND/DISPLAY ; C:\PROGRAM FILES\HEXAGON\PC-DMIS 2018 R2 64-BIT\EN\PCD2EXCEL.EXE


But, I don't want to be able to click on anything. I don't know where to start with writing this Marco or script but if anyone had any tips or pointers that would be helpful or even examples. I can work with that and figure it out. Just need a starting point.

My objective is to have the machinist start the part and do nothing else and just have the report auto generate at the end of each program. Create an excel sheet with all the information that PCD2Excel would generate. I simply just want to eliminate the process of clicking on the button.
Parents
  • On newer versions of the software (I'm guessing 2015 and later - can't remember when this feature as added) there is an option to output to Excel. That's under File - Printing - Report Window Print Setup. The third tab is titled Excel. I'm pretty sure that uses PCD2Excel to create the output. If not, it is practically the same. That will auto output the report the way you described.

    If you need to get fancier and use variables to assign special file names or paths for each execution, you can insert a print report command at the end of your measuring routine and put variables in those fields as needed.
Reply
  • On newer versions of the software (I'm guessing 2015 and later - can't remember when this feature as added) there is an option to output to Excel. That's under File - Printing - Report Window Print Setup. The third tab is titled Excel. I'm pretty sure that uses PCD2Excel to create the output. If not, it is practically the same. That will auto output the report the way you described.

    If you need to get fancier and use variables to assign special file names or paths for each execution, you can insert a print report command at the end of your measuring routine and put variables in those fields as needed.
Children
  • Yes, I'm aware of this. I just want to for the report to be automatically generated in an excel report once the program reaches the end. I was told this can be achieved by making a script or macro. But I'm not sure how to go about this since I'm still new to PCDMIS
  • , I'm not quite sure what you are looking for.

    I read: "My objective is to have the machinist start the part and do nothing else and just have the report auto generate at the end of each program. Create an excel sheet with all the information that PCD2Excel would generate. I simply just want to eliminate the process of clicking on the button."

    Using the built in Excel Report output will do that. If you select either the 'Append' or the 'Auto' output option, the software will automatically output a report to an excel document after each execution without the operator needing to click or typing anything. 'Append' will keep adding the data to one long excel file. 'Auto' will create a new Excel file for each part appended with a sequence number. There is also a 'Prompt' option if you want a Save-as window to open up, but I'm guessing that is more operator interaction than you want.

    If you want to automatically change the file name or file location for each report, that is where you can use variables in your measuring routine and use a print report command. You can probably even find examples in this forum of people doing that inside a loop.

    You may also consider going to Insert - Report Command - Excel Form Report. That lets you create custom excel reports. However, I haven't found a lot of documentation on how to use it.

    It is true that you can do this with custom scripts but getting the measurement data from each type of report command can be a lengthy ordeal, especially if your measuring routine uses a lot of XactMeasure or GeoTol report commands. And you may need to update this script in the future if new features are added to the software. I think a few people here had a hard time upgrading from 2020R1 to a later version because the new GeoTol commands were not compatible with their custom scripts. If you really want to get into that the folks here can help you, but you may want to consider simpler options first.