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 ![]()
Hello,
Yes it does works !
# name : Trigger on resource change
# script-type : Python
# description : Trigger on resource change
# onResourceChange : *.capella
print(argv[0] + " - " + argv[1])
Happy euphoria !
Arnaud
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
Hi,
The 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[0] 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).
Regards,
Arnaud
Hello,
Is there a way to get which element has changed to limit the script scope? For instance, if I modify anything except a System function, then the script won’t be executed?