hexagon logo

Accessing FCF True Position in VB

Hello,

Does anyone know the commands to access the True Position Measured values using VB? The typical "Commands.DimensionCommands.Measured" does not apply to TP. I am writing a new macro for Excel to import data from PC-DMIS. All of the current examples only refer to location type dimensions. Also, please advise if there is a better place to post this.

Thanks!

t.
Parents
  • Just looking though the Object browser have your tried using the

    "DimensionCmd" Class?

    The members of this class look like they are all about GD&T.



    Yes - I get the all too familiar "object doesn't support this property of method" Sample code follows...

    Private Sub CommandButton1_Click()
    Dim app As Object, cmds As Object, Cmd As Object, part As Object, PartProgram As Object
    Set app = CreateObject("PCDLRN.Application")
    Set part = app.ActivePartProgram
    Set cmds = part.Commands

    Dim irow As Integer, icol As Integer, currentcol As Integer
    Dim s As String
    s = ""
    irow = 10
    icol = ActiveSheet.Cells(2, 14)
    currentcol = icol + 4

    For Each Cmd In cmds
    ActiveSheet.Cells(irow, 16) = Cmd.ID
    ActiveSheet.Cells(irow, 17) = Cmd.Type
    ActiveSheet.Cells(irow, 18) = Cmd.TypeDescription
    If Cmd.Type = 184 Then ' Its a TP Dimension
    ActiveSheet.Cells(irow, currentcol) = part.DimensionCmd.Measured

    ElseIf Cmd.Type = DIMENSION_X_LOCATION Or Cmd.Type = DIMENSION_Y_LOCATION Or Cmd.Type = DIMENSION_Z_LOCATION Then
    ActiveSheet.Cells(irow, currentcol) = Cmd.DimensionCommand.Measured
    End If
    irow = irow + 1
    Next Cmd
    icol = icol + 1
    ActiveSheet.Cells(2, 14) = icol
    End Sub

    *** Also tried Cmd.DimensionCmd.Measured
Reply
  • Just looking though the Object browser have your tried using the

    "DimensionCmd" Class?

    The members of this class look like they are all about GD&T.



    Yes - I get the all too familiar "object doesn't support this property of method" Sample code follows...

    Private Sub CommandButton1_Click()
    Dim app As Object, cmds As Object, Cmd As Object, part As Object, PartProgram As Object
    Set app = CreateObject("PCDLRN.Application")
    Set part = app.ActivePartProgram
    Set cmds = part.Commands

    Dim irow As Integer, icol As Integer, currentcol As Integer
    Dim s As String
    s = ""
    irow = 10
    icol = ActiveSheet.Cells(2, 14)
    currentcol = icol + 4

    For Each Cmd In cmds
    ActiveSheet.Cells(irow, 16) = Cmd.ID
    ActiveSheet.Cells(irow, 17) = Cmd.Type
    ActiveSheet.Cells(irow, 18) = Cmd.TypeDescription
    If Cmd.Type = 184 Then ' Its a TP Dimension
    ActiveSheet.Cells(irow, currentcol) = part.DimensionCmd.Measured

    ElseIf Cmd.Type = DIMENSION_X_LOCATION Or Cmd.Type = DIMENSION_Y_LOCATION Or Cmd.Type = DIMENSION_Z_LOCATION Then
    ActiveSheet.Cells(irow, currentcol) = Cmd.DimensionCommand.Measured
    End If
    irow = irow + 1
    Next Cmd
    icol = icol + 1
    ActiveSheet.Cells(2, 14) = icol
    End Sub

    *** Also tried Cmd.DimensionCmd.Measured
Children
No Data