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
  • This Before and After settings are available in 2021.2 version.



  • davehocum


    I am aware of the hazards of incremental moves. I do not use them exclusively, My primary use is as you proposed, short transitions always away from the model, primarily like an avoidance move would be. KIRBSTER269's illustration is excellent and appreciated. davehocum's comment is intriguing. All this considered, my desire remains, I feel the convenience of thinking in the incremental mindset while programming outweighs the hazards that incremental moves present. My preference doesn't matter much, as it is my organization's policy not to use them. Well, at least not let them remain after the program is proven and posted.

    What I propose is a script that converts them after the program is finished. One that figures out the XYZ of where the incremental move starts, adds the XYZ translations of the incremental move itself, calculates the coordinates of the resultant position and hardcodes that position as a move point. I assume there is some existing infrastructure for these calculations, as this is exactly what PC-DMIS is doing when you click "Show Path Lines". Speaking of pathlines, I understand that I can go through and manipulate them to accomplish roughly what I'm after, but in a large program this would take a considerable amount of time.

    Does this exist? How difficult would it be to make it exist? Can you think of any Commands or functions that would help?
  • I apologize for side tracking this thread, I personal do not have a an answer for you.
  • replace the command itself should be easy,
    interesting is to find the right startpoint from the increment movement.
    You have to check the last "Hit" and consider the ClearanceCube.
    i think it should be possible to extract this informations and build a script around it.
    But i dont have a working script


  • What I propose is a script that converts them after the program is finished. One that figures out the XYZ of where the incremental move starts, adds the XYZ translations of the incremental move itself, calculates the coordinates of the resultant position and hardcodes that position as a move point. I assume there is some existing infrastructure for these calculations, as this is exactly what PC-DMIS is doing when you click "Show Path Lines". Speaking of pathlines, I understand that I can go through and manipulate them to accomplish roughly what I'm after, but in a large program this would take a considerable amount of time.

    Does this exist? How difficult would it be to make it exist? Can you think of any Commands or functions that would help?


    I have not seen a script that can do that. I'm trying to think of ways to make one, but the challenge is calculating the XYZ position after executing a feature and then executing a move increment. Doing that would need to account for your probe radius, retract values, and/or any avoidance moves built into auto features. That's beyond my skillset.

    I can think of two options that might make it easier to convert increment moves to point moves. One is to select the move increment command and the feature right before it in the edit window, while in offline mode. Then, press Ctrl+L to execute just those two features. This will move the probe to the location of the equivalent move point position. Then, move the cursor to the line with the move increment command and press Ctrl+M. That will put a move point there. Then make sure you delete the move increment command. Now that I have typed that all out, I wonder if a script could be made to automatically do those steps for each instance of a move/increment command in a measuring routine. That seems less daunting, but still beyond my skillset.

    Option 2 is to select the move increment command and the feature right before it in the edit window and then right click on the selected features, select Path, then select Path Lines. This will show you the path lines for just that feature and the move increment command. Now, zoom in on the end point of the move increment path and click on the path line as close to the end as you can. That will open up the 'Move Path Line' dialog box. The values in the XYZ boxes will be the point along the path line that you clicked. You can increment these up and down if you want, but if you just click OK it will insert a move point that is awfully close to the same place as the move increment would place you. Then again, make sure to delete the move increment command.


  • The challenge is calculating the XYZ position after executing a feature and then executing a move increment. Doing that would need to account for your probe radius, retract values, and/or any avoidance moves built into auto features.


    Yes, with that line you have captured the challenge better than I have myself previously. Thank you. Working all that out with a script would be daunting.



    Select the move increment command and the feature right before it in the edit window, while in offline mode. Then, press Ctrl+L to execute just those two features. This will move the probe to the location of the equivalent move point position. Then, move the cursor to the line with the move increment command and press Ctrl+M. That will put a move point there. Then make sure you delete the move increment command. Now that I have typed that all out, I wonder if a script could be made to automatically do those steps for each instance of a move/increment command in a measuring routine.


    That idea you had in option one sounds like a winner! You are right, It absolutely must be executed offline. But if the script could choose the correct features and somehow replicated those Keystrokes, I believe the problem could be solved.

    Move down the edit window searching for an incremental move. Select that move and the immediate feature or move that precedes it. After both are selected, Emulate pressing CTRL+E so the computer moves the digital stylus to where the two features conclude in 3D space. Wait 60 seconds for that operation to complete, then emulate pressing CTRL+M to capture that point in 3D space as a Move Point immediately after the Incremental move in the edit window. Then delete the incremental move, move the cursor to the line after the Move point, and start over at step 1, looping the whole sequence over and over until the cursor reaches the end of the program.

    Now that it is spelled out, does anybody see a problem with this roadmapConfused? If not, What expressions are required to emulate the key pressesConfused?
  • Hi my friend, i tryed to write a script for that, because it's sound like fun.
    i calculate the movepoints from the last hit by consider the "clearence Plane" or the "retract Value" .

    but i have a problem Slight smile
    I cant extract the info from the "clearence Cube", so it will not work with that.

    sorry i think i cant help you.
    your roadmap sound a bit .. complicated
  • Hi my friend, i tryed to write a script for that, because it's sound like fun.
    i calculate the movepoints from the last hit by consider the "clearence Plane" or the "retract Value" .

    but i have a problem
    I cant extract the info from the "clearence Cube", so it will not work with that.

    sorry i think i cant help you.
    your roadmap sound a bit .. complicated


    Hmm, I know nothing of scripting in PC-DMIS, but intuitively I would think your approach is more complicated. You are trying to mathematically derive positions, vectors, and 6dof transformations in 3D space. The approach me and Cris_C were hinting at would leave all that heavy math work to existing software features of PC-DMIS, and would simply emulate a human being pressing some keys. The offline animated probe graphically traverses the path of the highlighted commands when CTRL+E is pressed, and comes to rest at the resultant position of the incremental move, then CTRL+M captures the absolute location of that resultant position as a "Move Point". No math is required, simply a matter of highlighting the correct sequence of commands to execute, the selection would be the complicated part... I would assume... Am I wrong? Confused

    Can one search for instances of a command in the edit window?
    Can one select the results of that search?
    Can one execute the selected commands?
    Can one record the DRO position of the digital stylus point at the end of execution?


  • Can one search for instances of a command in the edit window?
    Can one select the results of that search?
    Can one execute the selected commands?
    Can one record the DRO position of the digital stylus point at the end of execution?


    I'm a little bummed to be as busy as I am, this seems like a fun thing to play with. I am kinda working on it in the back of my mind and I think I have cleared some to the hurdles.

    You can identify move commands in the program with the IsMove Property. Link to Help file: https://docs.hexagonmi.com/pcdmis/2021.1/en/helpcenter/mergedProjects/automationobjects/webframe.html#PCDLRN~Command~IsMove.html

    I haven't gotten as far as finding how to distinguish incremental moves from the other types of moves. May need to use gettext to find the command information to sort it out.

    It looks like selecting the features to be executed can be done with the SetExecutionBlock Method. Link to Help file: https://docs.hexagonmi.com/pcdmis/2021.1/en/helpcenter/mergedProjects/automationobjects/webframe.html#PCDLRN~PartProgram~SetExecutionBlock.html

    I think it can be executed with the EXECUTE Method (Odd how it is in all caps in the documentation, as if it's extra important): Link to Help file: https://docs.hexagonmi.com/pcdmis/2021.1/en/helpcenter/mergedProjects/automationobjects/webframe.html#PCDLRN~Command~EXECUTE.html

    That's as far as I have got. I haven't gotten as far as finding a way to insert a move point command on the desired line of the measuring routine or deleting the move increment command that is replacing it.

    Once it is all figured out, I'm not sure if such a script can be run from the Basic Script Editor built into PC-DMIS or if it would need to be run externally from something like an Excel script or a .bas file. The later versions of windows 10 now support executing .bas files just by double clicking on them, so that wouldn't be too hard to implement if needed.