PostTechOnFrameChanged
Le rappel
PostTechOnFrameChanged(
) est appelé depuis le noyau lorsque l’outil ou la trame de base a été modifié au niveau de l’opération.
Il peut être utilisé pour :
-
obtenir des valeurs d’attribut
-
définir les valeurs des attributs
-
sortie vers le journal
-
accéder à OlpController
-
accéder au parseur SCV
-
obtenir le chemin complet vers le fichier de la table technologique
-
obtenir un nouveau changement de nom de trame, d’index, de type, de matrice et de matrice mondiale
Le rappel peut retourner une valeur booléenne. Il n’est pas nécessaire de retourner Faux, car la valeur par défaut est de toute façon Faux :
-
Vrai : s’il est nécessaire d’effectuer une opération, recalculer (ENTERSTATE_STARTWITHRULEEVENTS) après la fin du rappel
-
Faux : pas de recalcul
Le rappel est défini dans le
%TechnologyName%.py
qui se trouve dans le dossier scripts du
.
def PostTechOnFrameChanged(Operator):
attribGetter = Operator.GetAttribGetter()
attribSetter = Operator.GetAttribSetter()
olpController = Operator.GetController()
toolIndex = olpController.GetActiveToolFrameIndex()
baseIndex = olpController.GetActiveBaseFrameIndex()
csvParser = Operator.GetCsvParserOperator()
iRet = csvParser.LoadCsvFile(" ..\\TechTabs\\WeldingAttrib.csv")
filePath = Operator.GetTechTabFolder("WeldingAttrib.csv")
logging.LogInfo("TechTab path: " + str(filePath))
changedFrameName = Operator.GetChangedFrameName()
logging.LogInfo("Newly changed frame name: " + str(changedFrameName))
changedFrameIndex = Operator.GetChangedFrameIndex()
logging.LogInfo("Newly changed frame index: " + str(changedFrameIndex))
changedFrameType = Operator.GetChangedFrameType()
if changedFrameType == FRAMETYPE_BASE:
logging.LogInfo("Newly changed frame type: Base")
if changedFrameType == FRAMETYPE_TOOL:
logging.LogInfo("Newly changed frame type: Tool")
matrix = Operator.GetChangedFrameMatrix()
if matrix.IsValid():
logging.LogInfo("Matrix position: " + str(matrix.GetPosition().GetXYZ()))
logging.LogInfo("Matrix rotation: " + str(matrix.GetRotation()))
else:
logging.LogInfo("Matrix is not valid!")
worldMatrix = Operator.GetChangedFrameWorldMatrix()
if worldMatrix.IsValid():
logging.LogInfo("World matrix position: " + str(worldMatrix.GetPosition().GetXYZ()))
logging.LogInfo("World matrix rotation: " + str(worldMatrix.GetRotation()))
else:
logging.LogInfo("World matrix is not valid!")
# Set to True when a recompute is required
requestStartWithRuleEventsRecompute = True
return requestStartWithRuleEventsRecompute