1
Automation Interface, Add-Ins and Tools / Difference between "normal" script execution and debug execution?
« on: September 27, 2023, 10:09:23 pm »
Hello,
What is the difference between a script execution in EA between executing the script normally (e.g. for a project explorer script this is right click on element in project explorer->Scripts->ScriptName) and the debug execution of the script (by opening the script in EA, select the appropriate element in the project explorer and click on the "Play" button above the script.
There seems to be a difference because the same script runs perfectly when launching it via the Play button, but will stop at a certain line when executing it from the project explorer. It will always stop on the same line, at least printf-debugging leads to that assumption.
The "faulty" line is the following:
sourceObj = sequence.GetDiagramObjectByID(sourceElement.ElementID, null);
sourceElement.ElementID is a valid ID, and will be printed out when iterating over all DiagramObjects via sequence.DiagramObjects.GetAt(j)
The workaround is obviously iterating over the DiagramObjects and finding the correct Element. But I'd like to understand what could be the difference here...
What is the difference between a script execution in EA between executing the script normally (e.g. for a project explorer script this is right click on element in project explorer->Scripts->ScriptName) and the debug execution of the script (by opening the script in EA, select the appropriate element in the project explorer and click on the "Play" button above the script.
There seems to be a difference because the same script runs perfectly when launching it via the Play button, but will stop at a certain line when executing it from the project explorer. It will always stop on the same line, at least printf-debugging leads to that assumption.
The "faulty" line is the following:
sourceObj = sequence.GetDiagramObjectByID(sourceElement.ElementID, null);
sourceElement.ElementID is a valid ID, and will be printed out when iterating over all DiagramObjects via sequence.DiagramObjects.GetAt(j)
The workaround is obviously iterating over the DiagramObjects and finding the correct Element. But I'd like to understand what could be the difference here...