hexagon logo

Move Increment to Move Point Conversion Script?

Confused Is anybody familiar with a script that will scour your program and replace all the Move Increments with Move Points in the alignment context in which the moves reside? My team really doesn't like Move increments, but I really like the convenience while programing. It would be neat if there were a macro that converts them all with a click of a button.Confused
  • hm, i think about it
    * you need a real part for this
    * a working partprogramm
    * i dont know, if you can execute a partprogram partialy, but you need that for this task
    * inside and delete commands while excute a partprogramm .. dont realy work i think, it has to be tested

    -> inside a Move command from the actual tip position is easy trougth
    -> there is a event for exceuted commands that sound good
  • Hi,
    @


    with this you can extract probe Position in Offline mode
    Private Sub test()
     
      Dim App As PCDLRN.Application
      Set App = CreateObject("PCDLRN.Application")
      Dim Part As PCDLRN.PartProgram
      Set Part = App.ActivePartProgram
    
      Dim MA As Object
      Set MA = App.Machines("OFFLINE")
     
      'MsgBox MA.Name
      MsgBox MA.ProbePosition.X & " - " & MA.ProbePosition.Y & " - " & MA.ProbePosition.Z
    End Sub
    


    this is interesting
    i can execute a program partway in Offline-Mode and than extract the probe position.
    a Quick test shows that he extract the right probe data on every stop even with fancy aligment changes.
    thats cool, in offline mode you cant destroy something

    i try to build a working script for this in some days
  • Hmm, this gives coordinates in the current alignment in the edit window? Or coordinates in the machine alignment? If it uses the current alignment, then this is a very useful command.

    When your previous script iterates through commands, does it start with the first line of the edit window and just scroll line by line until it reaches the bottom? or does it follow the context of the commands. For example, if the iteration reaches a loop command, will the script loop with the program or simply continue as it would if the loop wasn't there? Another way of asking is the script aware of flow control?
  • previous script goes from command to command and ignores any loop or "goto" mark
    :/
  • I was so slammed this weekend I didn't get a chance to test the script. three consecutive 14hour days.
  • Hi my friends,

    here you go

    MoveInc2.txt

    *1)
    i had a lot of problems with the script engine from pcDMIS, the "Wait" or "Sleep" function is simply not working,
    so i cant say the script to wait for the excuted partprogram (the sleep from win32 api works but interrupts the excuted partprogram too, so its sleeps forever ^^)
    -> this script only works as a macro from Excel !

    *2)
    the partprogramm has to be open and in "OFFLINE-mode"

    *3)
    the script searches for increment movement,
    than execute the Partprogram to this point,
    insert a movement-Point with extracted probeposition,
    and delete the increment movement
    until no increment movement found.

    *4)
    the script is based on extracted probeposition in Offline mode,
    if the virtual controler has not the right points for some strange reasons
    this will not work at all (i have made two positiv tests)

    *5)
    the partprogramm will be excuted partways .. thats why it will NOT work with goto commands or flow-control commands.
    absolut movements in loops is maybe not a good idee anyway.

    Attached Files
  • THANK YOU , If this script executes as I interpret it to this will be satisfactory for this time, and an excellent start point for the future. If you think about it, this script accomplishes almost exactly the same thing your last script did using only half the lines. Your problem with the wait and sleep commands seems like it would be infuriatingly frustrating when common simple commands just inexplicably do not work without hint or explanation. I have encountered situations like this myself and they make me fighting mad. Anyway, I think I know of a program to test this on but like usual my soonest opportunity will be this weekend and even then it will depend on workload. Again, THANK YOU sir.SmileySmileySmiley
  • ConfusedIn the meanwhile, has anybody else experienced his headache with the WAIT and SLEEP commands ? Did you overcome it ? If so, How did you overcome it ?Confused
  • Confusedin the meanwhile, has anybody else experienced his headache with the wait and sleep commands ? did you overcome it ? if so, how did you overcome it ?Confused


    youtube
  • easy: i ignore the problem, means the script "MoveInc2" will only be working as an excel macro.

    the sleep function is working correctly .. complete pcDMIS (not only the script) will wait.
    The instanz that plays the script has to be different as the instanz who excute the partprogramm, thats why with excel macro

    maybe there is a coding trick to overcome this, but i dont know it at this time