Has anyone used the magic header: “OnResourceChange”? I’m looking to implement it to auto-run scripts when a change happens somewhere in the model. If there is another solution to this problem It’ll make my world a euphoria
Yes it does works !
# name : Trigger on resource change # script-type : Python # description : Trigger on resource change # onResourceChange : *.capella print(argv + " - " + argv)
Happy euphoria !
name : Trigger on resource change
script-type : Python
description : Trigger on resource change
onResourceChange : In-Flight Entertainment System.capella
here is my test header, I tried making changes to the model by adding components and exchanges but still haven’t had my scripts execute. Am I missing something? @ArnaudDieumegard
onResourceChange field must be exactly the
*.capella value. It expects a file extension. See EASE/Scripts - Eclipsepedia.
# onResourceChange : *.capella
Then in the script code
argv gets you the name of the resource that triggered the execution of the script. You should then retrieve the model from this information and do whatever you want (test it to only apply the script on the desired model for example).