Skip to Content
Python APIFlux de travailScripts technologiques

Scripts technologiques

Un script technologie est un fichier Python nommé d’après la technologie (par exemple, ArcWelding.py). Il se trouve dans le dossier des scripts technologiques à l’intérieur du plugin .

Lorsque le noyau traite une technologie, il appelle ces rappels dans l’ordre :

Chaîne de rappel

Référence de classe opérateur → rappel

RappelClasse d’opérateurObjectif
PostTechInitAttributesCENPyOlpTech_AttribInitOperatorAttributs technologiques de création/lecture/écriture
PostTechInitEventsCENPyOlpTech_EventInitOperatorInscrivez des événements technologiques
PostTechInitRulesCENPyOlpTech_RuleInitOperatorRègles de la technologie du registre
PostInitManufacturingGeometryCENPyOlpTech_MfGeoInitOperatorInitialisation de la géométrie de fabrication
PostProcessGroupOpérationAttributesCENPyOlpTech_POGAttribOperatorAttributs du groupe d’opérations de lecture/écriture
PostTechUpdateCENPyOlpTech_UpdateOperatorAppelée lors de la mise à jour technologique
PrevExecuteRecipeCENPyOlpTech_RecipeOperatorExécutions avant l’exécution de la recette
PostTechOnAttribChangedCENPyOlpTech_AttribChangedOperatorRéagit aux changements d’attribut
PostTechOnFrameChangedCENPyOlpFrameChangedOperatorRéagit aux changements de frame

Schéma typique

def PostTechInitAttributes(techAttribInitOperator): # Create custom attributes creator = techAttribInitOperator.GetAttribCreator() creator.AddDouble('WeldSpeed', 10.0, 0, 100, 0.5, USER_ATTRIBUTE | PROCESS_ATTRIBUTE, ATTRIB_SPEED, 'Weld Speed') def PostTechOnAttribChanged(techAttribChangedOperator): # React to user changing an attribute name = techAttribChangedOperator.GetChangedAttribName() if name == 'WeldSpeed': getter = techAttribChangedOperator.GetAttribGetter() speed = getter.GetDouble('WeldSpeed') logOp = techAttribChangedOperator.GetLoggerOperator() logOp.LogInfo(f'Weld speed changed to {speed}')
Was this page helpful?