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
  • Hi,

    thanks for your assistance. I will try that later. Maybe I find the right IDs.
    For the moment I have just skipped this query because it is ok for me to export all dimensions.


    Ralf (and all),

    Look up SetToggleString for OUTPUT_TYPE instead of going directly for the strings.
    I use this method to set the output value in one of my automation scripts:

    retval = PCDCommand.SetToggleString (1, OUTPUT_TYPE, 0)


    Incorporated into a dimension evaluation (creating it):

    Set PCDCommand = PCDCommands.Add (DIMENSION_START_LOCATION, True)
        retval = PCDCommand.PutText ("P" & cnt, ID, 0)
        retval = PCDCommand.PutText ("MP" & cnt, REF_ID, 0)
    
        retval = PCDCommand.SetToggleString (1, OUTPUT_TYPE, 0)
    
        retval = PCDCommand.SetToggleString (2, UNIT_TYPE, 0)
      Set PCDCommand = PCDCommands.Add (DIMENSION_X_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_Y_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_Z_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_D_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_END_LOCATION, True)
        PCDCommand.Marked = True
Reply
  • Hi,

    thanks for your assistance. I will try that later. Maybe I find the right IDs.
    For the moment I have just skipped this query because it is ok for me to export all dimensions.


    Ralf (and all),

    Look up SetToggleString for OUTPUT_TYPE instead of going directly for the strings.
    I use this method to set the output value in one of my automation scripts:

    retval = PCDCommand.SetToggleString (1, OUTPUT_TYPE, 0)


    Incorporated into a dimension evaluation (creating it):

    Set PCDCommand = PCDCommands.Add (DIMENSION_START_LOCATION, True)
        retval = PCDCommand.PutText ("P" & cnt, ID, 0)
        retval = PCDCommand.PutText ("MP" & cnt, REF_ID, 0)
    
        retval = PCDCommand.SetToggleString (1, OUTPUT_TYPE, 0)
    
        retval = PCDCommand.SetToggleString (2, UNIT_TYPE, 0)
      Set PCDCommand = PCDCommands.Add (DIMENSION_X_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_Y_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_Z_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_D_LOCATION, True)
      Set PCDCommand = PCDCommands.Add (DIMENSION_END_LOCATION, True)
        PCDCommand.Marked = True
Children
No Data