Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
SteffenG
Posted - 08/03/2021 : 06:59:13 AM OriginPro 2019 (64-bit) 9.6.0.172 German Windows 10
Dear all,
I wonder if there are differences between moving an object or resize it in terms of trigger respective script within the object. Here are the details: I have a rectangle linked to a layer. The rectangle contains a script which should change something in a second layer. The script execution should be done by resize the rectangle or move it. Therefore I choose the respective criterion. Unfortunately the script is running correctly only if I am moving the rectangle. If I resize it some of the script is running okay but some function do not work. As far as I see there might be some issue with switching from one layer to the other. I recognize the switching in case of moving the rectangle but no switching is to be seen if I resize it. Funny thing: If I choose first the layer of the rectangle the script runs well also in case of resizing. I am really confused.
Hope, someone has an idea to solve the problem or work around.
Best regards Steffen
3 L A T E S T R E P L I E S (Newest First)
SteffenG
Posted - 08/04/2021 : 03:45:33 AM Dear all,
Thanks for your comments. I am aware of the different methodologies to change the place of execution of scripts. My question is more related to the background of the implementation of the resizing versus moving trigger event in Origin itself. Are there any differences in the handling or execution of these events?
I was able to determine which command breaks the execution of my scripts in case of using resizing. It is
draw -n fftcheck -v get;
The object fftcheck is located in the first layer. It looks like the object will not be found in case of resizing event but in case of moving event everything works fine.
I solved the problem now by adding an additional
layer -s 1;
right before the
draw ...
line. There is the same layer select command some lines before in the script.
Again: The script was runnig perfectly in case of moving the rectangle but not in case of resizing.
It looks like the resizing event has some timing issue. If I start from layer 2 and resize the rectangle in layer 1 the layer select commands within the scripts of used objects are only effective for some short period of time. If I want to be sure to target to the correct layer I have to repeat the layer select commands several times, regardless if the selected layer will be the same as before. May be it has something to do with internal graphic routines.
Best regards Steffen
cpyang
Posted - 08/03/2021 : 1:01:05 PM Yes, like
layer -o 2 {type "my scripts";}
If you need to do something in layer 2 context from layer 1.
CP
YimingChen
Posted - 08/03/2021 : 09:27:35 AM It's hard to tell what is going on. Maybe you can send us a sample project file showing the issue.