VorherigesRezeptAusführen
The callback Bool PrevExecuteRecipe (CENPyOlpTech_RecipeOperator) is called before the kernel executes the technology recipe.
| return(True) | Das vordefinierte Technologie-Rezept wird nicht ausgeführt (Verwenden Sie dies, wenn der Callback das Technologie-Rezept neu definiert). |
| return(False) | Die vordefinierte Technologie-Rezeptur wird nach diesem Callback ausgeführt (Verwenden, wenn der Callback nichts bewirkt) |
Es kann verwendet werden, um:
-Technologie-Rezept mit Python-Skript überschreiben
-Zugriff auf ProcessGeometryOperator
-
Attributwerte abrufen (aus Rezept, Vorgangsgruppe und Vorgang)
-
Attributwerte festlegen (für Operationsgruppe und Operation)
-
Ausgabe in das Protokoll
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 callbackWas this page helpful?