Skip to Content

ProgramProcessGeométries

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

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

from centypes import * from cenpylib import * def GetCommandName(): return "ProgramPG"

 

def GetCommandUuId(): return "A2BN5471-TAB7-4AF1-98E1-U87AQD13E73D"

 

def GetIconName(): return "COM_ScriptsRun" def ProgramProcessGeometries(Operator): logging = Operator.GetLoggerOperator() pgs = Operator.GetSelectedProcessGeometries(PROCGEO_CONTOUR) for counter, pg in enumerate(pgs, 1): logging.LogInfo(f"PG <{counter}> name= {pg.GetProcessGeometryName()} length= {pg.GetContourLength()}.") controller = Operator.GetController() startStates = Operator.GetStartStateNames() for counter, startState in enumerate(startStates, 1): logging.LogInfo(f"Start state <{counter}> name= {startState}.") program = controller.CreateProgram(startState, startState, False) program = Operator.GetActiveProgram() isSuccessful = program.ProgramProcessGeometries(pgs, 3, 1) if isSuccessful: logging.LogInfo("Process geometry was successfully programmed.") else: logging.LogError("Failed to program process geometry.")
Was this page helpful?