Skip to Content

PrévExécuteRecipe

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

retour (Vrai)La recette prédéfinie par la technologie ne sera pas exécutée (À utiliser si le rappel redéfinit la recette technologique)
return (Faux)La recette technologique prédéfinie sera exécutée après ce rappel (À utiliser si le rappel ne fait rien)

Il peut être utilisé pour :

  • Recette de dérogation technologique avec un script Python

-accéder à ProcessGéométrie Opérateur

  • obtenir des valeurs d’attribut (à partir de la recette, du groupe d’opérations et de l’opération)

  • définir les valeurs d’attribut (vers groupe d’opérations et opération)

  • sortie au journal

The callback is defined in the %TechnologyName%.py file that is located in the scripts folder of the plugin.

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