hexagon logo

Script Help Needed - Export Xactmeasure dimensions

I have a program that reports several Xactmeasure line profiles. I have to put the max/min values of each profile into a spreadsheet. Right now I do that by hand. I'm looking for a way to automate the process using a script. I have a script that I use to extract nominal and measured values for points and am thinking I can modify it but I have no idea how to "find" the Xactmeasure profile dimensions in my program within the script. Any ideas?
  • Digging out the results from FCF:s by script is (nicely put) a bit cumbersome. Not at all as easy and straightforward as for legacy dimensions. Disappointed

    Look at the VB code accompanying the PCD2Excel Wizard (in the Wizards subfolder of your installation).

    Or use the PCD2Excel Wizard to export the values to an Excel sheet, and write a VBA macro in Excel to extract the columns you need and put them at the right place in your final Excel sheet.
  • The problem with using the wizard is it only gives me the measured profile. I need min and max. Looks like I'll have to do it the long way by assigning the min/max values to variable then file-open, file-write.

    Or perhaps I can edit the VB code for the wizard to include the min/max values...
  • the CSV_FULL_REPORT_XACTMEASURE_dot_BAS.txt file that you run as a script will export the max/min for you. I know, because I remember being dissapointed that it told me max/mins and not the measured data!

    PCD2EXCELL works pretty good, except on GD&T dims... it always shows the "measured" value as 0 when exported... you have to look into the deviation column to get the value for measured that appears on the report.. i wish there was a way to fix that one! That makes it a pain to organize in excel when the data you want is scattered into 2 different columns!

    I can e-mail that .bas and instructions to you if you would like.

    Sam
  • I would very much like to get a copy of that script! PM sent.

    You could also post here and maybe it would benefit someone else as well.
  • You could also post here and maybe it would benefit someone else as well.


    +1
  • UPDATE: Hexagon says the option to export min/max from a FCF profile dimension is not available in the PCD2Excel wizard. So I guess I need to come up with a script. Any takers?
  • If you activate showing MAX/MIN (F10) and use File -> Export -> Text... both the MEAS, MAX and MIN of a profile FCF will be in the text file. The format of this file is like CSV, so it can be opened more or less directly in Excel and massaged by an Excel macro to move the correct values to the correct places in a destination worksheet.

    Unfortunately this kind of export can't be automated (as far as I know), you have to do the menu choices manually. Maybe the menu activation can be automated from Excel, so you might get by with only one button click in Excel after each part is measured, but I don't know that for sure.

    Or you can try changing the PCD2Excl wizard...
  • I need a way to automate this. We have around 50 parts in a lot and each part has 27-33 line section profile dimensions to report, depending on the part number. I will end up adding a lot of code to the end of my program to put the min/max dimensions into variables then creating, opening, writing, closing a file. I will then have to open the file in Excel and create a macro to format the data into our spreadsheet.

    Thanks anyway for the suggestions everyone.
  • I have a script that I use to extract nominal and measured values for points and am thinking I can modify it but I have no idea how to "find" the Xactmeasure profile dimensions in my program within the script. Any ideas?


    This works in 2012 MR1.

    Sub Main()
    Dim pcd As Application
    Dim cmd As Command
    
    Set pcd = CreateObject("PCDLRN.application.7.1", "")
    
    For Each cmd In pcd.ActivePartProgram.Commands
      If cmd.IsFCFCommand Then
        If cmd.FCFCommand.HasProfileDimension Then
          MsgBox (cmd.FCFCommand.ProfileDimension.Max)
          MsgBox (cmd.FCFCommand.ProfileDimension.Min)
        End If
      End If
    Next cmd
    
    End Sub


    "Command.IsFCFCommand" was not available in 2010MR3. I see you are on 2011MR1, I do not know when this was added. Some adjustment may be necessary.
  • This works in 2012 MR1.

    Sub Main()
    Dim pcd As Application
    Dim cmd As Command
    
    Set pcd = CreateObject("PCDLRN.application.7.1", "")
    
    For Each cmd In pcd.ActivePartProgram.Commands
      If cmd.IsFCFCommand Then
        If cmd.FCFCommand.HasProfileDimension Then
          MsgBox (cmd.FCFCommand.ProfileDimension.Max)
          MsgBox (cmd.FCFCommand.ProfileDimension.Min)
        End If
      End If
    Next cmd
    
    End Sub



    "Command.IsFCFCommand" was not available in 2010MR3. I see you are on 2011MR1, I do not know when this was added. Some adjustment may be necessary.



    Unfortunately this is not working. It appears "FCFCommand" is not available in 2011. I need to figure out how to find a FCF command in 2011. Thank you for the suggestion though!