hexagon logo

Request machine events to help

Who can help me to explain the the Machine in DistanceToClosestCAD events how to use? Thank you!
  • ?

    It's a boolean flag with which you decide what to show in the probe readout window.
  • I want an example, rather than help file introduced.
  • I think you need to catch the events from an external program like a customized app or Excel, I don't know if events work within a script.

    There is/was a file called "automationtest_eventhandling.zip" available at the script repository which you could take a look at (it utilized an Excelfile to catch the events).
  • I think you need to catch the events from an external program like a customized app or Excel, I don't know if events work within a script.

    There is/was a file called "automationtest_eventhandling.zip" available at the script repository which you could take a look at (it utilized an Excelfile to catch the events).


    Will the information on here?
  • Return the favour by posting any code you complete in the "PC-DMIS Code Samples" section, please.

    automationtest_eventhandling.zip
  • Can not seem to download this file, I can send to my mailbox? Thank you!
    Email:859027136@qq.com
  • Public WithEvents PartEvents As pcdlrn.PartProgram
    Public WithEvents MachineEvents As pcdlrn.Machine
    Public WithEvents AppMeasureEvents As pcdlrn.ApplicationObjectEvents

    Private Sub Form_Load()

    Set PCDMISApp = CreateObject("PCDLRN.Application")

    Set AppMeasureEvents = PCDMISApp.ApplicationEvents
    Set PartEvents = PCDMISApp.ActivePartProgram
    Set MachineEvents = PCDMISApp.ActivePartProgram.ActiveMachine

    End Sub


    Private Sub MachineEvents_Command(ByVal Code As Long)

    List8.AddItem ("Machine Command : " + Str$(Code))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_DistanceToClosestCAD(ByVal dX As Double, ByVal dY As Double, ByVal dZ As Double, ByVal T As Double, ByVal tol As Double)

    List8.AddItem ("Machine Distance To ClosestCad : " + Str$(dX) + "-" + Str$(dY) + "-" + Str$(dZ) + "-" + Str$(T) + "--" + Str$(tol))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_DistanceToTarget(ByVal dX As Double, ByVal dY As Double, ByVal dZ As Double, ByVal T As Double, ByVal tol As Double)

    List8.AddItem ("Machine Distance To Target : " + Str$(dX) + "-" + Str$(dY) + "-" + Str$(dZ) + "-" + Str$(T) + "--" + Str$(tol))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_ErrorMsg(ByVal Msg As String, ByVal ErrorType As Long)

    List8.AddItem ("Machine ErrorMsg : " + Msg)
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_ExecuteHit(ByVal X As Double, ByVal Y As Double, ByVal Z As Double, ByVal I As Double, ByVal J As Double, ByVal K As Double)

    List8.AddItem ("Machine Execute Hit : " + Str$(X) + "-" + Str$(Y) + "-" + Str$(Z) + "-" + Str$(I) + "-" + Str$(J) + "-" + Str$(K))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_ExecuteManualScanHit(ByVal X As Double, ByVal Y As Double, ByVal Z As Double, ByVal I As Double, ByVal J As Double, ByVal K As Double)

    List8.AddItem ("Machine Manual Scan Hit : " + Str$(X) + "-" + Str$(Y) + "-" + Str$(Z) + "-" + Str$(I) + "-" + Str$(J) + "-" + Str$(K))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_FeatureID(ByVal fid As String)

    List8.AddItem ("Machine FeatureID : " + fid)
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_FeatureType(ByVal ftype As String)

    List8.AddItem ("Machine Feature Type : " + ftype)
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_LearnHit(ByVal X As Double, ByVal Y As Double, ByVal Z As Double, ByVal I As Double, ByVal J As Double, ByVal K As Double)

    List8.AddItem ("Machine Learn Hit : " + Str$(X) + "-" + Str$(Y) + "-" + Str$(Z) + "-" + Str$(I) + "-" + Str$(J) + "-" + Str$(K))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_Readout(ByVal X As Double, ByVal Y As Double, ByVal Z As Double, ByVal I As Double, ByVal J As Double, ByVal K As Double)

    List8.AddItem ("Machine ReadOut : " + Str$(X) + "-" + Str$(Y) + "-" + Str$(Z) + "-" + Str$(I) + "-" + Str$(J) + "-" + Str$(K))
    List8.TopIndex = List8.NewIndex

    End Sub

    Private Sub MachineEvents_RMS(ByVal RMS As Double)

    List8.AddItem ("Machine Events RMS : " + Trim$(Str$(RMS)))
    List8.TopIndex = List8.NewIndex


    End Sub
  • Thank you! I know so, but still can not get the value of the DistanceToClosestCAD inside Will this event What does it mean?