Skip to Content

ModifyActiveProgram

Le rappel ModifyActiveProgram (

CENPyOlpProgramModifyOperator

) est appelé manuellement par l’utilisateur sur le programme actif ou automatiquement (

Noms de script d’exécution automatique prédéfinis

).

Le rappel est défini dans le fichier cenpyDefProgram.py.

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)
Was this page helpful?