hexagon logo

PC-Dmis to Excel, through PC-Dmis Script

I know there is currently a VB project that runs in Excel during execution that will pull information into the workbook during execution. I decided to venture out and try some of my own approaches with a combination of data I found online here and there.

What I have is a script that can be executed in program, without too much setup and hassle, that will export data into an excel workbook like a print command would. I feel this script offers a little more versatility.

I will not claim ownership of this program. I just tweaked it to fit my needs. So far I have it running, and it works quite well.

I will answer what questions I can, but for the most part I wanted to post it to have as a reference.

It's a long program........
Parents
  • Above is a 3 part drop in script. You will need to copy and paste it all together.

    Note 1: If you notice in the first section, you need to add a default excel file for reference as a security means.
    Note 2: The version of excel you are using is important. As Default it uses the extension .xlsx
    Note 3: The following code snippet requires these variables in your Pc-Dmis program to be implemented. If you want to use the default program data, that can be done as well. Just change the code.
    Set CMMPrognam = Part.GetVariableValue("CMMPROGRAM")
    Set Partnu = Part.GetVariableValue("PARTNUMBER")
    Set Partna = Part.GetVariableValue("PARTNAME")
    Set Printrevver = Part.GetVariableValue("PRINTREV1")
    Set Samp = Part.GetVariableValue("SAMP")
    Note 4: The optional math functions are for your use. If you don't want them, delete them out. BUT! you can't leave them in there if you dry run. throws zeroes out and causes errors.
    Note 5: Please notice that even if you dim out in negatives, everything in this script uses Abs values and rounds out to 6 places. For the math functions to work, it had to be done.
    Note 6: Your dimensions can't be 0 +/- tol. For obvious reasons, your averages and other values will be wrong. So you may use dimensions like this, but you can't use the math functions.
Reply
  • Above is a 3 part drop in script. You will need to copy and paste it all together.

    Note 1: If you notice in the first section, you need to add a default excel file for reference as a security means.
    Note 2: The version of excel you are using is important. As Default it uses the extension .xlsx
    Note 3: The following code snippet requires these variables in your Pc-Dmis program to be implemented. If you want to use the default program data, that can be done as well. Just change the code.
    Set CMMPrognam = Part.GetVariableValue("CMMPROGRAM")
    Set Partnu = Part.GetVariableValue("PARTNUMBER")
    Set Partna = Part.GetVariableValue("PARTNAME")
    Set Printrevver = Part.GetVariableValue("PRINTREV1")
    Set Samp = Part.GetVariableValue("SAMP")
    Note 4: The optional math functions are for your use. If you don't want them, delete them out. BUT! you can't leave them in there if you dry run. throws zeroes out and causes errors.
    Note 5: Please notice that even if you dim out in negatives, everything in this script uses Abs values and rounds out to 6 places. For the math functions to work, it had to be done.
    Note 6: Your dimensions can't be 0 +/- tol. For obvious reasons, your averages and other values will be wrong. So you may use dimensions like this, but you can't use the math functions.
Children
No Data