Page 1 of 1

Reloading of Script before execution

Posted: Mon Sep 26, 2011 3:09 pm
by hungerburg
Andrew, how do you do it, that a script gets reloaded from file on each execution?

The first custom script, the one that is called from the menu or button, will be reloaded each time, if the "beginEvent" hook ends with a "delete Foo" statement, Foo being the name of the class itself.

But classes instantiated inside of this class will not be reloaded the next time the first one is instantiated, and if I delete them, they will be missing then.

There must be a special trick that you apply and that I dont understand. Would you explain?

Peter

Posted: Mon Sep 26, 2011 3:59 pm
by andrew
We've introduced the command line option -always-load-scripts for this:

./qcad -always-load-scripts

See also output of:

./qcad -help

Deleting classes is no longer required with this switch.

QCAD3 rocks

Posted: Tue Sep 27, 2011 9:57 am
by hungerburg
Ahh, this is good news for people like me, that follow a very iterative approach to development - Thank You.

I tried now calling a script from commandline with the name specified for such occasions in the "beginEvent", but get this Warning: RGuiAction::getByScriptFile: no action found: "MyScript".

Using the path relative to the qcad3 root "scripts/..." works though. Using the -exec argument after a filename will even first load the file and then perform the action on it in one go. Great!

Re: QCAD3 rocks

Posted: Wed Sep 28, 2011 12:21 pm
by andrew
hungerburg wrote:I tried now calling a script from commandline with the name specified for such occasions in the "beginEvent", but get this Warning: RGuiAction::getByScriptFile: no action found: "MyScript".
The -exec switch expects an absolute or relative path to a script that contains a class with the same name as the file name and has a beginEvent function.

If I understand you correctly, you tried to pass -exec a class name. That is an interesting thought. Feature request:

http://www.ribbonsoft.com/bugtracker/in ... ask_id=277

Re: Reloading of Script before execution

Posted: Sat Jun 02, 2018 8:11 pm
by MikeMillerPE
Hi,

I'm trying to do this on Windows 10 command line with QCAD 3.20.1.0, using the modified form from within f:\Program Files\QCAD\.

qcad -always-load-scripts.

I get the splash screen but the program aborts. Is there another way to enter the command line switch?

Thanks in advance,

Re: Reloading of Script before execution

Posted: Wed Jun 06, 2018 9:34 am
by andrew
I can confirm this is broken and will likely be fixed in the next version.