Python scripting - Auxiliary commands callbacks

ModifyActiveProgram

Previous  Chapter  Next

 

The callback ModifyActiveProgram(CENPyOlpProgramModifyOperator) is called manually by user on the active program or automatically (Predefined auto execute script names).

 

The callback is defined in cenpyDefProgram.py file.

 

ModifyActiveProgram

 

[Example]

from centypes import *

from cenpylib import *

 

def GetCommandName():

  return "TranslateTpe"

 

def GetCommandUuId():

  return "I7BN5571-AAB7-4AF9-98E1-887A2D13E73D"

 

def GetIconName():

  return "COM_ScriptsRun"

 

def ModifyActiveProgram(Operator):

  teachHandler = Operator.GetTeachHandler()

  program = Operator.GetActiveProgram()

  tpElements = program.GetToolpathElements()

  position = teachHandler.GetTpElementPosition(tpElements[2], POSRELATION_WORKPIECEROOT)

  position.TranslatePosition(0.1, 0, 0.1, POSRELATION_WORKPIECEROOT)

  teachHandler.ModifyTpElement(position)

 


ModifyActiveProgram_Ex

 


Previous
Previous page
Chapter
Chapter page
Next
Next page