Python scripting - Technology callbacks

PrevExecuteRecipe

 

The callback Bool PrevExecuteRecipe(CENPyOlpTech_RecipeOperator) is called before the kernel executes the technology recipe.

 

 

return(True)

Technology predefined recipe will not be executed (Use if the callback redefines technology recipe)

return(False)

Technology predefined recipe will be executed after this callback (Use if callback does nothing)

 

It can be used to:

-override technology recipe with python script

-access ProcessGeometryOperator

- get attribute values (from recipe, operation group and operation)

- set attribute values (to operation group and operation)

- output to the log

 

The callback is defined inthe %TechnologyName%.py file.

 

PrevExecuteRecipe

 

[Example]

File: Samples\JenoptikPluginUpdated\Plugin\TechnologyPackages\LaserCuttingTechnology\Jenoptik\LaserCuttingTechnology.py

 

# The sample below overrides built in LaserCuttingTechnology recipe to use only contour workmethod 

#  for all process geometries (contours and regshapes)

 

def PrevExecuteRecipe(recipeOperator):

   logOperator = recipeOperator.GetLoggerOperator()

   attribGetter = recipeOperator.GetAttribGetter()   

   

   #useRegshape = attribGetter.GetBool("UseRegshape");   

   #logOperator.LogDebug('useRegshape: ' + str(useRegshape))

   

   pgOperators = recipeOperator.GetSelectedProcessGeometries()   

   opGroup = recipeOperator.GetOperationGroup()

   pgOperatorsCount = len(pgOperators)

 

   #logOperator.LogDebug('Size: ' + str(pgOperatorsCount))

 

   for i in range(0, pgOperatorsCount):

      pgOperator = pgOperators[i]

      #isRegshapeOp = pgOperator.IsRegshape()

      #logOperator.LogDebug('pgOperator[' + str(i) +'] IsRegshape = '+ str(isRegshapeOp))

      opGroup.CreateOperation('CONTOUR_METHOD', pgOperator) # use CONTOUR_METHOD for all process geometries

   return(True) # True - Technology recipe will not be executed, False - Technology recipe will be executed after this callback

 


PrevExecuteRecipe_Ex

 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante