Users Forum

HYRCAN Category => Feature Requests/Future Directions => Topic started by: JesseB on October 03, 2021, 09:50:15 pm

Title: Accessing variables in script
Post by: JesseB on October 03, 2021, 09:50:15 pm
Hi,

I have been playing around with the scripting which i do find extremely useful.

A useful feature would be to be able to access the FOS as a variable after running a model (maybe this is already possible but it is not clear how it could be done).

I have tried using the return value of the compute() method however it appears to return nothing after it runs so i am not sure where the FOS is stored.

This could be useful in running a loop which checks the FOS after a computation and changes the model if the FOS is too low by adjusting the slope or any loading until the FOS becomes acceptable.

Thanks,
Jesse
Title: Re: Accessing variables in script
Post by: Roozbeh on October 04, 2021, 09:11:48 am
Hi Jesse,

thanks for the comments. yes this is in the list. I'm currently working on couple of other subroutines when it's done, I will take a look at scripting functions.

-Roozbeh
Title: Re: Accessing variables in script
Post by: JesseB on October 22, 2021, 03:57:23 pm
Hi Roozbeh,

I understand you are busy with other items at the moment but when you come back around to this item i think the way to achieve it would be as follows.

Within the QT script add the following line that should run at the end of 'compute()':

engine.globalObject().setProperty('fos',*FOS_VARIABLE*)

where FOS_VARIABLE is the slope factor of safety determined after computation

See below:
https://doc.qt.io/qt-5/qtscript-index.html#making-a-qobject-available-to-the-script-engine

Thanks,
Jesse
Title: Re: Accessing variables in script
Post by: Roozbeh on October 24, 2021, 02:03:27 pm
thanks, it's going to be done differently in the HYRCAN but same concept.
Title: Re: Accessing variables in script
Post by: Roozbeh on November 03, 2021, 05:02:34 pm
In the new version (i.e. V1.75.1), you will be able to extract some information. Please take a look at uploaded script:

http://geowizard.org/forum/index.php?topic=356.msg1128#msg1128

also look at page "Set/Get Information" under "Scripting Language" in the help menu.